Skip to content

Commit

Permalink
chore: composer install
Browse files Browse the repository at this point in the history
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
  • Loading branch information
come-nc committed Feb 4, 2025
1 parent c504bf5 commit a81b79a
Show file tree
Hide file tree
Showing 11 changed files with 80 additions and 31 deletions.
27 changes: 23 additions & 4 deletions vendor/composer/InstalledVersions.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ class InstalledVersions
*/
private static $installed;

/**
* @var bool
*/
private static $installedIsLocalDir;

/**
* @var bool|null
*/
Expand Down Expand Up @@ -309,6 +314,12 @@ public static function reload($data)
{
self::$installed = $data;
self::$installedByVendor = array();

// when using reload, we disable the duplicate protection to ensure that self::$installed data is
// always returned, but we cannot know whether it comes from the installed.php in __DIR__ or not,
// so we have to assume it does not, and that may result in duplicate data being returned when listing
// all installed packages for example
self::$installedIsLocalDir = false;
}

/**
Expand All @@ -322,19 +333,27 @@ private static function getInstalled()
}

$installed = array();
$copiedLocalDir = false;

if (self::$canGetVendors) {
$selfDir = strtr(__DIR__, '\\', '/');
foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
$vendorDir = strtr($vendorDir, '\\', '/');
if (isset(self::$installedByVendor[$vendorDir])) {
$installed[] = self::$installedByVendor[$vendorDir];
} elseif (is_file($vendorDir.'/composer/installed.php')) {
/** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
$required = require $vendorDir.'/composer/installed.php';
$installed[] = self::$installedByVendor[$vendorDir] = $required;
if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
self::$installed = $installed[count($installed) - 1];
self::$installedByVendor[$vendorDir] = $required;
$installed[] = $required;
if (self::$installed === null && $vendorDir.'/composer' === $selfDir) {
self::$installed = $required;
self::$installedIsLocalDir = true;
}
}
if (self::$installedIsLocalDir && $vendorDir.'/composer' === $selfDir) {
$copiedLocalDir = true;
}
}
}

Expand All @@ -350,7 +369,7 @@ private static function getInstalled()
}
}

if (self::$installed !== array()) {
if (self::$installed !== array() && !$copiedLocalDir) {
$installed[] = self::$installed;
}

Expand Down
1 change: 0 additions & 1 deletion vendor/composer/autoload_classmap.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
'NC\\Updater\\UpdateCommand' => $baseDir . '/lib/UpdateCommand.php',
'NC\\Updater\\UpdateException' => $baseDir . '/lib/UpdateException.php',
'NC\\Updater\\Updater' => $baseDir . '/lib/Updater.php',
'NC\\Updater\\Version' => $baseDir . '/lib/Version.php',
'Nextcloud\\CodingStandard\\Config' => $vendorDir . '/nextcloud/coding-standard/src/Config.php',
'Normalizer' => $vendorDir . '/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php',
'PhpToken' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php',
Expand Down
1 change: 0 additions & 1 deletion vendor/composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ class ComposerStaticInit936ba63ded5d1b8248cdb4d5673af0ea
'NC\\Updater\\UpdateCommand' => __DIR__ . '/../..' . '/lib/UpdateCommand.php',
'NC\\Updater\\UpdateException' => __DIR__ . '/../..' . '/lib/UpdateException.php',
'NC\\Updater\\Updater' => __DIR__ . '/../..' . '/lib/Updater.php',
'NC\\Updater\\Version' => __DIR__ . '/../..' . '/lib/Version.php',
'Nextcloud\\CodingStandard\\Config' => __DIR__ . '/..' . '/nextcloud/coding-standard/src/Config.php',
'Normalizer' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php',
'PhpToken' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php',
Expand Down
28 changes: 14 additions & 14 deletions vendor/composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,24 +62,24 @@
},
{
"name": "nextcloud/coding-standard",
"version": "v1.1.1",
"version_normalized": "1.1.1.0",
"version": "v1.2.1",
"version_normalized": "1.2.1.0",
"source": {
"type": "git",
"url": "https://github.com/nextcloud/coding-standard.git",
"reference": "55def702fb9a37a219511e1d8c6fe8e37164c1fb"
"reference": "cf5f18d989ec62fb4cdc7fc92a36baf34b3d829e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nextcloud/coding-standard/zipball/55def702fb9a37a219511e1d8c6fe8e37164c1fb",
"reference": "55def702fb9a37a219511e1d8c6fe8e37164c1fb",
"url": "https://api.github.com/repos/nextcloud/coding-standard/zipball/cf5f18d989ec62fb4cdc7fc92a36baf34b3d829e",
"reference": "cf5f18d989ec62fb4cdc7fc92a36baf34b3d829e",
"shasum": ""
},
"require": {
"php": "^7.3|^8.0",
"php-cs-fixer/shim": "^3.17"
},
"time": "2023-06-01T12:05:01+00:00",
"time": "2024-02-01T14:54:37+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
Expand All @@ -100,23 +100,23 @@
"description": "Nextcloud coding standards for the php cs fixer",
"support": {
"issues": "https://github.com/nextcloud/coding-standard/issues",
"source": "https://github.com/nextcloud/coding-standard/tree/v1.1.1"
"source": "https://github.com/nextcloud/coding-standard/tree/v1.2.1"
},
"install-path": "../nextcloud/coding-standard"
},
{
"name": "php-cs-fixer/shim",
"version": "v3.17.0",
"version_normalized": "3.17.0.0",
"version": "v3.51.0",
"version_normalized": "3.51.0.0",
"source": {
"type": "git",
"url": "https://github.com/PHP-CS-Fixer/shim.git",
"reference": "f51b4aed90565c447136f1d015798f6f7c82490f"
"reference": "a792394f7f3934f75a4df9dca544796c6f503027"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHP-CS-Fixer/shim/zipball/f51b4aed90565c447136f1d015798f6f7c82490f",
"reference": "f51b4aed90565c447136f1d015798f6f7c82490f",
"url": "https://api.github.com/repos/PHP-CS-Fixer/shim/zipball/a792394f7f3934f75a4df9dca544796c6f503027",
"reference": "a792394f7f3934f75a4df9dca544796c6f503027",
"shasum": ""
},
"require": {
Expand All @@ -131,7 +131,7 @@
"ext-dom": "For handling output formats in XML",
"ext-mbstring": "For handling non-UTF8 characters."
},
"time": "2023-05-22T20:00:38+00:00",
"time": "2024-02-28T19:51:07+00:00",
"bin": [
"php-cs-fixer",
"php-cs-fixer.phar"
Expand All @@ -155,7 +155,7 @@
"description": "A tool to automatically fix PHP code style",
"support": {
"issues": "https://github.com/PHP-CS-Fixer/shim/issues",
"source": "https://github.com/PHP-CS-Fixer/shim/tree/v3.17.0"
"source": "https://github.com/PHP-CS-Fixer/shim/tree/v3.51.0"
},
"install-path": "../php-cs-fixer/shim"
},
Expand Down
18 changes: 9 additions & 9 deletions vendor/composer/installed.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
'name' => '__root__',
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'reference' => 'de0582d00a183fca1d5645d354e88b94b9b75a90',
'reference' => 'c504bf596664d9b1fb3f4142da00084a05e93e0d',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
Expand All @@ -13,7 +13,7 @@
'__root__' => array(
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'reference' => 'de0582d00a183fca1d5645d354e88b94b9b75a90',
'reference' => 'c504bf596664d9b1fb3f4142da00084a05e93e0d',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
Expand All @@ -31,22 +31,22 @@
'friendsofphp/php-cs-fixer' => array(
'dev_requirement' => true,
'replaced' => array(
0 => 'v3.17.0',
0 => 'v3.51.0',
),
),
'nextcloud/coding-standard' => array(
'pretty_version' => 'v1.1.1',
'version' => '1.1.1.0',
'reference' => '55def702fb9a37a219511e1d8c6fe8e37164c1fb',
'pretty_version' => 'v1.2.1',
'version' => '1.2.1.0',
'reference' => 'cf5f18d989ec62fb4cdc7fc92a36baf34b3d829e',
'type' => 'library',
'install_path' => __DIR__ . '/../nextcloud/coding-standard',
'aliases' => array(),
'dev_requirement' => true,
),
'php-cs-fixer/shim' => array(
'pretty_version' => 'v3.17.0',
'version' => '3.17.0.0',
'reference' => 'f51b4aed90565c447136f1d015798f6f7c82490f',
'pretty_version' => 'v3.51.0',
'version' => '3.51.0.0',
'reference' => 'a792394f7f3934f75a4df9dca544796c6f503027',
'type' => 'application',
'install_path' => __DIR__ . '/../php-cs-fixer/shim',
'aliases' => array(),
Expand Down
27 changes: 27 additions & 0 deletions vendor/nextcloud/coding-standard/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,33 @@
# Changelog
All notable changes to this project will be documented in this file.

## 1.2.1 - 2024-02-01
### Fix
* fix: Remove `fully_qualified_strict_types` again by @nickvergessen in https://github.com/nextcloud/coding-standard/pull/16

## 1.2.0 - 2024-02-01
### Added
- `array_syntax`: Force short syntax for array
- `list_syntax`: Same for list
- ~~`fully_qualified_strict_types`: Remove namespace from classname when there is a `use` statement, and add missing backslash for global namespace~~ - Removed in 1.2.1 due to issues
- `no_leading_import_slash`: Remove leading slash from `use` statement
- `nullable_type_declaration_for_default_null_value`: Add missing `?` on type declaration for parameters defaulting to `null`. This will most likely be needed to avoid warnings in PHP 8.4.
- `yoda_style`: forbid yoda style comparision. This replaces `null === $a` by `$a === null`.

## 1.1.1 - 2023-06-23
### Changed
* feat: use php-cs-fixer/shim by @kesselb in https://github.com/nextcloud/coding-standard/pull/13

## 1.1.0 - 2023-04-13
### Changed
* Order imports alphabetically by @come-nc in https://github.com/nextcloud/coding-standard/pull/10
* fix(rules): Replace deprecated braces rules by @nickvergessen in https://github.com/nextcloud/coding-standard/pull/12

## 1.0.0 – 2021-11-10
### Breaking change
* Update php-cs-fixer to 3.x
* See https://github.com/nextcloud/coding-standard#upgrade-from-v0x-to-v10 for instructions.

## 0.5.0 – 2021-01-11
### Added
- New rule: short list syntax
Expand Down
2 changes: 1 addition & 1 deletion vendor/nextcloud/coding-standard/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ For convenience you may add it to the `scripts` section of your `composer.json`:
}
```

*Note: Don't forget to exclude .php_cs.dist in your build scripts.*
*Note: Don't forget to exclude `.php-cs-fixer.dist.php` and `.php-cs-fixer.cache` in your build scripts.*

## Upgrade from v0.x to v1.0

Expand Down
5 changes: 5 additions & 0 deletions vendor/nextcloud/coding-standard/src/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public function getRules() : array {
'@PSR2' => true,
'align_multiline_comment' => true,
'array_indentation' => true,
'array_syntax' => true,
'binary_operator_spaces' => [
'default' => 'single_space',
],
Expand All @@ -35,16 +36,19 @@ public function getRules() : array {
],
'indentation_type' => true,
'line_ending' => true,
'list_syntax' => true,
'lowercase_keywords' => true,
'method_argument_space' => [
'on_multiline' => 'ignore',
],
'no_closing_tag' => true,
'no_leading_import_slash' => true,
'no_spaces_after_function_name' => true,
'no_spaces_inside_parenthesis' => true,
'no_trailing_whitespace' => true,
'no_trailing_whitespace_in_comment' => true,
'no_unused_imports' => true,
'nullable_type_declaration_for_default_null_value' => true,
'ordered_imports' => [
'imports_order' => ['class', 'function', 'const'],
'sort_algorithm' => 'alpha'
Expand All @@ -57,6 +61,7 @@ public function getRules() : array {
'visibility_required' => [
'elements' => ['property', 'method', 'const']
],
'yoda_style' => ['equal' => false, 'identical' => false, 'less_and_greater' => false],
];
}
}
2 changes: 1 addition & 1 deletion vendor/php-cs-fixer/shim/logo.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
The logo is © 2010-2022 Sensio Labs.
The logo is © 2010+ Sensio Labs.

Original resolution can be found at https://github.com/PHP-CS-Fixer/logo .
Binary file modified vendor/php-cs-fixer/shim/php-cs-fixer.phar
Binary file not shown.
Binary file modified vendor/php-cs-fixer/shim/php-cs-fixer.phar.asc
Binary file not shown.

0 comments on commit a81b79a

Please sign in to comment.