Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
125 changes: 104 additions & 21 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,119 @@
"description": "Write and deploy modern PHP 8 code, today.",
"type": "composer-plugin",
"require": {
"php": ">=8.0",
"phabel/php-parser": "^94.10",
"php": ">=5.6 <5.7",
"ext-json": "*",
"composer-plugin-api": "^2.0",
"symfony/console": "^5",
"symfony/process": "^5",
"amphp/parallel": "^1.4",
"psr/log": "^1.0",
"ext-json": "*"
"ext-tokenizer": "*"
},
"require-dev": {
"composer/composer": "^1|^2",
"haydenpierce/class-finder": "^0.4.2",
"symfony/polyfill-php80": "^1.23",
"symfony/polyfill-php70": "*",
"symfony/polyfill-php71": "*",
"symfony/polyfill-php72": "*",
"symfony/polyfill-php73": "*",
"symfony/polyfill-php74": "*",
"bamarni/composer-bin-plugin": "^1.4"
},
"provide": {
"phabelio/phabel": "self.version"
},
"license": "MIT",
"authors": [{
"name": "Daniil Gentili",
"email": "daniil@daniil.it"
}],
"authors": [
{
"name": "Daniil Gentili",
"email": "daniil@daniil.it"
}
],
"autoload": {
"psr-4": {
"Phabel\\": "src"
}
"Phabel\\": "src",
"Phabel\\Amp\\": [
"vendor-bundle/amphp/amp/lib"
],
"Phabel\\Amp\\ByteStream\\": [
"vendor-bundle/amphp/byte-stream/lib"
],
"Phabel\\Amp\\Parallel\\": [
"vendor-bundle/amphp/parallel/lib"
],
"Phabel\\Amp\\Parser\\": [
"vendor-bundle/amphp/parser/lib"
],
"Phabel\\Amp\\Process\\": [
"vendor-bundle/amphp/process/lib"
],
"Phabel\\Amp\\Serialization\\": [
"vendor-bundle/amphp/serialization/src"
],
"Phabel\\Amp\\Sync\\": [
"vendor-bundle/amphp/sync/src"
],
"Phabel\\PhpParser\\": [
"vendor-bundle/phabel/php-parser/lib/PhpParser"
],
"Phabel\\Psr\\Container\\": [
"vendor-bundle/psr/container/src/"
],
"Phabel\\Psr\\Log\\": [
"vendor-bundle/psr/log/Psr/Log/"
],
"Phabel\\Symfony\\Component\\Console\\": [
"vendor-bundle/symfony/console/"
],
"Phabel\\Symfony\\Polyfill\\Ctype\\": [
"vendor-bundle/symfony/polyfill-ctype/"
],
"Phabel\\Symfony\\Polyfill\\Intl\\Grapheme\\": [
"vendor-bundle/symfony/polyfill-intl-grapheme/"
],
"Phabel\\Symfony\\Polyfill\\Intl\\Normalizer\\": [
"vendor-bundle/symfony/polyfill-intl-normalizer/"
],
"Phabel\\Symfony\\Polyfill\\Mbstring\\": [
"vendor-bundle/symfony/polyfill-mbstring/"
],
"Phabel\\Symfony\\Polyfill\\Php72\\": [
"vendor-bundle/symfony/polyfill-php72/"
],
"Phabel\\Symfony\\Polyfill\\Php73\\": [
"vendor-bundle/symfony/polyfill-php73/"
],
"Phabel\\Symfony\\Polyfill\\Php74\\": [
"vendor-bundle/symfony/polyfill-php74/"
],
"Phabel\\Symfony\\Polyfill\\Php80\\": [
"vendor-bundle/symfony/polyfill-php80/"
],
"Phabel\\Symfony\\Component\\Process\\": [
"vendor-bundle/symfony/process/"
],
"Phabel\\Symfony\\Contracts\\Service\\": [
"vendor-bundle/symfony/service-contracts/"
],
"Phabel\\Symfony\\Component\\String\\": [
"vendor-bundle/symfony/string/"
]
},
"files": [
"vendor-bundle/amphp/amp/lib/functions.php",
"vendor-bundle/amphp/amp/lib/Internal/functions.php",
"vendor-bundle/amphp/byte-stream/lib/functions.php",
"vendor-bundle/amphp/parallel/lib/Context/functions.php",
"vendor-bundle/amphp/parallel/lib/Sync/functions.php",
"vendor-bundle/amphp/parallel/lib/Worker/functions.php",
"vendor-bundle/amphp/process/lib/functions.php",
"vendor-bundle/amphp/serialization/src/functions.php",
"vendor-bundle/amphp/sync/src/functions.php",
"vendor-bundle/amphp/sync/src/ConcurrentIterator/functions.php",
"vendor-bundle/ralouphie/getallheaders/src/getallheaders.php",
"vendor-bundle/symfony/deprecation-contracts/function.php",
"vendor-bundle/symfony/polyfill-ctype/bootstrap.php",
"vendor-bundle/symfony/polyfill-intl-grapheme/bootstrap.php",
"vendor-bundle/symfony/polyfill-intl-normalizer/bootstrap.php",
"vendor-bundle/symfony/polyfill-mbstring/bootstrap.php",
"vendor-bundle/symfony/polyfill-php72/bootstrap.php",
"vendor-bundle/symfony/polyfill-php73/bootstrap.php",
"vendor-bundle/symfony/polyfill-php74/bootstrap.php",
"vendor-bundle/symfony/polyfill-php80/bootstrap.php",
"vendor-bundle/symfony/string/Resources/functions.php"
]
},
"autoload-dev": {
"psr-4": {
Expand Down Expand Up @@ -76,5 +157,7 @@
"config": {
"process-timeout": 0
},
"bin": ["bin/phabel"]
}
"bin": [
"bin/phabel"
]
}
37 changes: 3 additions & 34 deletions scoper.inc.php
Original file line number Diff line number Diff line change
@@ -1,51 +1,26 @@
<?php

declare(strict_types=1);

use Isolated\Symfony\Component\Finder\Finder;

return [
// The prefix configuration. If a non null value will be used, a random prefix will be generated.
'prefix' => 'Phabel',

// By default when running php-scoper add-prefix, it will prefix all relevant code found in the current working
// directory. You can however define which files should be scoped by defining a collection of Finders in the
// following configuration key.
//
// For more see: https://github.com/humbug/php-scoper#finders-and-paths
'finders' => [
Finder::create()->files()->in('src'),
Finder::create()
->files()
->ignoreVCS(true)
->notName('/LICENSE|.*\\.md|.*\\.dist|Makefile|composer\\.json|composer\\.lock/')
->exclude([
'doc',
'test',
'test_old',
'tests',
'Tests',
'vendor-bin',
])
->in('vendor'),
Finder::create()->append([
'composer.json',
]),
],

'finders' => [Finder::create()->files()->in('src'), Finder::create()->files()->ignoreVCS(true)->notName('/LICENSE|.*\\.md|.*\\.dist|Makefile|composer\\.json|composer\\.lock/')->exclude(['doc', 'test', 'test_old', 'tests', 'Tests', 'vendor-bin'])->in('vendor'), Finder::create()->append(['composer.json'])],
// Whitelists a list of files. Unlike the other whitelist related features, this one is about completely leaving
// a file untouched.
// Paths are relative to the configuration file unless if they are already absolute
'files-whitelist' => [],

// When scoping PHP files, there will be scenarios where some of the code being scoped indirectly references the
// original namespace. These will include, for example, strings or string manipulations. PHP-Scoper has limited
// support for prefixing such strings. To circumvent that, you can define patchers to manipulate the file to your
// heart contents.
//
// For more see: https://github.com/humbug/php-scoper#patchers
'patchers' => [],

// PHP-Scoper's goal is to make sure that all code for a project lies in a distinct PHP namespace. However, you
// may want to share a common API between the bundled code of your PHAR and the consumer code. For example if
// you have a PHPUnit PHAR with isolated code, you still want the PHAR to be able to understand the
Expand All @@ -55,23 +30,17 @@
// that this does not work with functions or constants neither with classes belonging to the global namespace.
//
// Fore more see https://github.com/humbug/php-scoper#whitelist
'whitelist' => [
'Phabel\*',
'Composer\*',
],

'whitelist' => ['Phabel\\*', 'Composer\\*'],
// If `true` then the user defined constants belonging to the global namespace will not be prefixed.
//
// For more see https://github.com/humbug/php-scoper#constants--constants--functions-from-the-global-namespace
'whitelist-global-constants' => true,

// If `true` then the user defined classes belonging to the global namespace will not be prefixed.
//
// For more see https://github.com/humbug/php-scoper#constants--constants--functions-from-the-global-namespace
'whitelist-global-classes' => true,

// If `true` then the user defined functions belonging to the global namespace will not be prefixed.
//
// For more see https://github.com/humbug/php-scoper#constants--constants--functions-from-the-global-namespace
'whitelist-global-functions' => true,
];
];
Loading