Skip to content

Commit

Permalink
Setting the PHP world free again ...
Browse files Browse the repository at this point in the history
  • Loading branch information
chr-hertel committed Feb 17, 2022
0 parents commit cb7656b
Show file tree
Hide file tree
Showing 23 changed files with 4,668 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
vendor
58 changes: 58 additions & 0 deletions README.md
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?!
37 changes: 37 additions & 0 deletions composer.json
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"
]
}
}
Loading

0 comments on commit cb7656b

Please sign in to comment.