Skip to content

Commit

Permalink
Updated Rector to commit 9ff238819b2cfed103b30766d2c0e33135abed38
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Jun 29, 2023
1 parent dac98be commit 6e8d9f0
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 43 deletions.
62 changes: 31 additions & 31 deletions rules/Naming/Naming/UseImportsResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,37 +22,6 @@ public function __construct(CurrentFileProvider $currentFileProvider)
{
$this->currentFileProvider = $currentFileProvider;
}
/**
* @return \PhpParser\Node\Stmt\Namespace_|\Rector\Core\PhpParser\Node\CustomNode\FileWithoutNamespace|null
*/
private function resolveNamespace()
{
/** @var File|null $file */
$file = $this->currentFileProvider->getFile();
if (!$file instanceof File) {
return null;
}
$newStmts = $file->getNewStmts();
if ($newStmts === []) {
return null;
}
$namespaces = \array_filter($newStmts, static function (Stmt $stmt) : bool {
return $stmt instanceof Namespace_;
});
// multiple namespaces is not supported
if (\count($namespaces) > 1) {
return null;
}
$currentNamespace = \current($namespaces);
if ($currentNamespace instanceof Namespace_) {
return $currentNamespace;
}
$currentStmt = \current($newStmts);
if (!$currentStmt instanceof FileWithoutNamespace) {
return null;
}
return $currentStmt;
}
/**
* @return Use_[]|GroupUse[]
*/
Expand Down Expand Up @@ -87,4 +56,35 @@ public function resolvePrefix($use) : string
{
return $use instanceof GroupUse ? $use->prefix . '\\' : '';
}
/**
* @return \PhpParser\Node\Stmt\Namespace_|\Rector\Core\PhpParser\Node\CustomNode\FileWithoutNamespace|null
*/
private function resolveNamespace()
{
/** @var File|null $file */
$file = $this->currentFileProvider->getFile();
if (!$file instanceof File) {
return null;
}
$newStmts = $file->getNewStmts();
if ($newStmts === []) {
return null;
}
$namespaces = \array_filter($newStmts, static function (Stmt $stmt) : bool {
return $stmt instanceof Namespace_;
});
// multiple namespaces is not supported
if (\count($namespaces) > 1) {
return null;
}
$currentNamespace = \current($namespaces);
if ($currentNamespace instanceof Namespace_) {
return $currentNamespace;
}
$currentStmt = \current($newStmts);
if (!$currentStmt instanceof FileWithoutNamespace) {
return null;
}
return $currentStmt;
}
}
4 changes: 2 additions & 2 deletions src/Application/VersionResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = '9d85c96cb1d90aeb6d03eed4856be6861dc07673';
public const PACKAGE_VERSION = '9ff238819b2cfed103b30766d2c0e33135abed38';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2023-06-29 10:52:03';
public const RELEASE_DATE = '2023-06-29 11:59:41';
/**
* @var int
*/
Expand Down
2 changes: 1 addition & 1 deletion vendor/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@

require_once __DIR__ . '/composer/autoload_real.php';

return ComposerAutoloaderInit66946d2f17dc4a5961b873af41863f35::getLoader();
return ComposerAutoloaderInita24b30f9c380e3b4383472b0cf89383a::getLoader();
10 changes: 5 additions & 5 deletions vendor/composer/autoload_real.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// autoload_real.php @generated by Composer

class ComposerAutoloaderInit66946d2f17dc4a5961b873af41863f35
class ComposerAutoloaderInita24b30f9c380e3b4383472b0cf89383a
{
private static $loader;

Expand All @@ -22,17 +22,17 @@ public static function getLoader()
return self::$loader;
}

spl_autoload_register(array('ComposerAutoloaderInit66946d2f17dc4a5961b873af41863f35', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInita24b30f9c380e3b4383472b0cf89383a', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInit66946d2f17dc4a5961b873af41863f35', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInita24b30f9c380e3b4383472b0cf89383a', 'loadClassLoader'));

require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit66946d2f17dc4a5961b873af41863f35::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInita24b30f9c380e3b4383472b0cf89383a::getInitializer($loader));

$loader->setClassMapAuthoritative(true);
$loader->register(true);

$filesToLoad = \Composer\Autoload\ComposerStaticInit66946d2f17dc4a5961b873af41863f35::$files;
$filesToLoad = \Composer\Autoload\ComposerStaticInita24b30f9c380e3b4383472b0cf89383a::$files;
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
Expand Down
8 changes: 4 additions & 4 deletions vendor/composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Composer\Autoload;

class ComposerStaticInit66946d2f17dc4a5961b873af41863f35
class ComposerStaticInita24b30f9c380e3b4383472b0cf89383a
{
public static $files = array (
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
Expand Down Expand Up @@ -3098,9 +3098,9 @@ class ComposerStaticInit66946d2f17dc4a5961b873af41863f35
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit66946d2f17dc4a5961b873af41863f35::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit66946d2f17dc4a5961b873af41863f35::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit66946d2f17dc4a5961b873af41863f35::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInita24b30f9c380e3b4383472b0cf89383a::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInita24b30f9c380e3b4383472b0cf89383a::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInita24b30f9c380e3b4383472b0cf89383a::$classMap;

}, null, ClassLoader::class);
}
Expand Down

0 comments on commit 6e8d9f0

Please sign in to comment.