Skip to content

Commit

Permalink
Try with scoper
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonmccreary committed Jul 31, 2023
1 parent cce6505 commit b69a653
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 4 deletions.
4 changes: 3 additions & 1 deletion box.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
"files": [
"composer.json"
],
"check-requirements": false,
"main": "shift-cli",
"output": "builds/shift-cli",
"compression": "GZ",
"compactors": [
"KevinGH\\Box\\Compactor\\Php"
"KevinGH\\Box\\Compactor\\Php",
"KevinGH\\Box\\Compactor\\PhpScoper"
]
}
Binary file modified builds/shift-cli
Binary file not shown.
23 changes: 23 additions & 0 deletions scoper.inc.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php declare(strict_types=1);

return [
'patchers' => [
function (string $filePath, string $prefix, string $content): string {
if ($filePath === 'src/ActionInvoker.php') {
return str_replace(
'\\\\Invoker\\\\Actions\\\\',
'\\\\'.$prefix.'\\\\Invoker\\\\Actions\\\\',
$content
);
}
return $content;
},
],
'exclude-files' => [
'vendor/illuminate/support/helpers.php',
'vendor/symfony/polyfill-php80/bootstrap.php'
],
'exclude-namespaces' => [
'Symfony\Polyfill\*'
]
];
3 changes: 2 additions & 1 deletion shift-cli
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/usr/bin/env php
<?php
// application.php

require 'vendor/autoload.php';
require __DIR__.'/vendor/autoload.php';

use Symfony\Component\Console\Application;
use Shift\Cli\Commands\DiscoverCommand;
Expand Down
3 changes: 1 addition & 2 deletions src/Tasks/ModelTableName.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@ class ModelTableName implements Task

public function perform(): int
{
var_dump(count(spl_autoload_functions()));

foreach ($this->findFilesContaining('/^class\s+/m') as $file) {
echo $file, PHP_EOL;;
$contents = file_get_contents($file);

$model = $this->modelClass($file);
Expand Down

0 comments on commit b69a653

Please sign in to comment.