-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Setting the PHP world free again ...
- Loading branch information
0 parents
commit cb7656b
Showing
23 changed files
with
4,668 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
vendor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Jæm3l Unfuck | ||
|
||
Since years the evolution of PHP has made it harder and harder to use vendor code without | ||
giving a fuck about the runtime. | ||
|
||
So, if you are tired by the burden OSS maintainers are putting onto you by | ||
* using the `final` keyword on classes or methods | ||
* reducing the visibility of properties or methods to `private` or `protected` | ||
* limiting capabilities by adding type declarations, return types or typed properties | ||
* forcing you to pass method arguments by making them mandatory | ||
* improving runtime stability | ||
|
||
Jæm3l got you covered! | ||
|
||
Just install jaem3l/unfuck to unfuck the vendor code your using and fuck up your own: | ||
``` | ||
$ composer require jaem3l/unfuck | ||
``` | ||
|
||
**Jæm3l Unfuck** will hook into the runtime to get rid of all that painful limitations and give | ||
you all that freedom to shoot yourself in the foot, back or head the way you desire the most. | ||
|
||
## Example | ||
|
||
Your vendor library provides you a feature class like | ||
|
||
```php | ||
final class Example | ||
{ | ||
private string $foo; | ||
|
||
public function __construct(string $foo) | ||
{ | ||
$this->foo = $foo; | ||
} | ||
|
||
private function getFoo(): string | ||
{ | ||
return $this->foo; | ||
} | ||
} | ||
``` | ||
|
||
but you're sure you want to use it like this: | ||
|
||
```php | ||
$inst = new class extends Example{}; | ||
$inst->foo = 42; | ||
|
||
var_dump($inst->getFoo()); | ||
``` | ||
|
||
With **Jæm3l Unfuck** you are finally free to do it. | ||
YOLO | ||
|
||
PS: This might impact runtime performance in time and memory consumption. But if you | ||
install this, you've already proven that you don't really care about your runtime. Why | ||
should this stop you?! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
"name": "jaem3l/unfuck", | ||
"type": "composer-plugin", | ||
"description": "The library to unfuck the vendor code and fuck up your own", | ||
"license": "MIT", | ||
"authors": [ | ||
{ | ||
"name": "Christopher Hertel", | ||
"email": "[email protected]" | ||
} | ||
], | ||
"require": { | ||
"php": "^8.1", | ||
"composer-plugin-api": "^2.0", | ||
"nikic/php-parser": "^4.13" | ||
}, | ||
"require-dev": { | ||
"composer/composer": "^2.0", | ||
"phpunit/phpunit": "^9.5" | ||
}, | ||
"extra": { | ||
"class": "Jæm3l\\Unfuck\\Plugin" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"Jæm3l\\Unfuck\\": "src/" | ||
} | ||
}, | ||
"autoload-dev": { | ||
"psr-4": { | ||
"Jæm3l\\Unfuck\\Tests\\": "tests/" | ||
}, | ||
"classmap": [ | ||
"example/Example.php" | ||
] | ||
} | ||
} |
Oops, something went wrong.