Skip to content

Commit cb7656b

Browse files
committed
Setting the PHP world free again ...
0 parents  commit cb7656b

23 files changed

+4668
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
vendor

README.md

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Jæm3l Unfuck
2+
3+
Since years the evolution of PHP has made it harder and harder to use vendor code without
4+
giving a fuck about the runtime.
5+
6+
So, if you are tired by the burden OSS maintainers are putting onto you by
7+
* using the `final` keyword on classes or methods
8+
* reducing the visibility of properties or methods to `private` or `protected`
9+
* limiting capabilities by adding type declarations, return types or typed properties
10+
* forcing you to pass method arguments by making them mandatory
11+
* improving runtime stability
12+
13+
Jæm3l got you covered!
14+
15+
Just install jaem3l/unfuck to unfuck the vendor code your using and fuck up your own:
16+
```
17+
$ composer require jaem3l/unfuck
18+
```
19+
20+
**Jæm3l Unfuck** will hook into the runtime to get rid of all that painful limitations and give
21+
you all that freedom to shoot yourself in the foot, back or head the way you desire the most.
22+
23+
## Example
24+
25+
Your vendor library provides you a feature class like
26+
27+
```php
28+
final class Example
29+
{
30+
private string $foo;
31+
32+
public function __construct(string $foo)
33+
{
34+
$this->foo = $foo;
35+
}
36+
37+
private function getFoo(): string
38+
{
39+
return $this->foo;
40+
}
41+
}
42+
```
43+
44+
but you're sure you want to use it like this:
45+
46+
```php
47+
$inst = new class extends Example{};
48+
$inst->foo = 42;
49+
50+
var_dump($inst->getFoo());
51+
```
52+
53+
With **Jæm3l Unfuck** you are finally free to do it.
54+
YOLO
55+
56+
PS: This might impact runtime performance in time and memory consumption. But if you
57+
install this, you've already proven that you don't really care about your runtime. Why
58+
should this stop you?!

composer.json

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"name": "jaem3l/unfuck",
3+
"type": "composer-plugin",
4+
"description": "The library to unfuck the vendor code and fuck up your own",
5+
"license": "MIT",
6+
"authors": [
7+
{
8+
"name": "Christopher Hertel",
9+
"email": "mail@christopher-hertel.de"
10+
}
11+
],
12+
"require": {
13+
"php": "^8.1",
14+
"composer-plugin-api": "^2.0",
15+
"nikic/php-parser": "^4.13"
16+
},
17+
"require-dev": {
18+
"composer/composer": "^2.0",
19+
"phpunit/phpunit": "^9.5"
20+
},
21+
"extra": {
22+
"class": "Jæm3l\\Unfuck\\Plugin"
23+
},
24+
"autoload": {
25+
"psr-4": {
26+
"Jæm3l\\Unfuck\\": "src/"
27+
}
28+
},
29+
"autoload-dev": {
30+
"psr-4": {
31+
"Jæm3l\\Unfuck\\Tests\\": "tests/"
32+
},
33+
"classmap": [
34+
"example/Example.php"
35+
]
36+
}
37+
}

0 commit comments

Comments
 (0)