Skip to content

Commit

Permalink
Mark Framework Interfaces as API part 3
Browse files Browse the repository at this point in the history
fix static


update
  • Loading branch information
mrtuvn committed Feb 22, 2021
1 parent c691317 commit 7d38777
Show file tree
Hide file tree
Showing 34 changed files with 204 additions and 92 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

declare(strict_types=1);

namespace Magento\Framework\Async;

/**
* Described deferred operation that can be canceled.
*
* @api
*/
interface CancelableDeferredInterface extends DeferredInterface
{
Expand Down
3 changes: 2 additions & 1 deletion lib/internal/Magento/Framework/Async/DeferredInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

declare(strict_types=1);

namespace Magento\Framework\Async;

/**
* Describes a value that will be available at later time.
*
* @api
*/
interface DeferredInterface
{
Expand Down
14 changes: 9 additions & 5 deletions lib/internal/Magento/Framework/Autoload/AutoloaderInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\Framework\Autoload;

/**
* Interface for an autoloader class that allows the dynamic modification of PSR-0 and PSR-4 mappings
*
* @api
*/
interface AutoloaderInterface
{
Expand All @@ -18,7 +22,7 @@ interface AutoloaderInterface
* @param bool $prepend Whether to append the given path or paths to the paths already associated with the prefix
* @return void
*/
public function addPsr4($nsPrefix, $paths, $prepend = false);
public function addPsr4($nsPrefix, $paths, $prepend = false): void;

/**
* Adds a PSR-0 mapping from a namespace prefix to directories to search in for the corresponding class
Expand All @@ -28,7 +32,7 @@ public function addPsr4($nsPrefix, $paths, $prepend = false);
* @param bool $prepend Whether to append the given path or paths to the paths already associated with the prefix
* @return void
*/
public function addPsr0($nsPrefix, $paths, $prepend = false);
public function addPsr0($nsPrefix, $paths, $prepend = false): void;

/**
* Creates new PSR-0 mappings from the given prefix to the given set of paths, eliminating previous mappings
Expand All @@ -37,7 +41,7 @@ public function addPsr0($nsPrefix, $paths, $prepend = false);
* @param string|array $paths The path or paths to look in for the given prefix
* @return void
*/
public function setPsr0($nsPrefix, $paths);
public function setPsr0($nsPrefix, $paths): void;

/**
* Creates new PSR-4 mappings from the given prefix to the given set of paths, eliminating previous mappings
Expand All @@ -46,15 +50,15 @@ public function setPsr0($nsPrefix, $paths);
* @param string|array $paths The path or paths to look in for the given prefix
* @return void
*/
public function setPsr4($nsPrefix, $paths);
public function setPsr4($nsPrefix, $paths): void;

/**
* Attempts to load a class and returns true if successful.
*
* @param string $className
* @return bool
*/
public function loadClass($className);
public function loadClass($className): bool;

/**
* Get filepath of class on system or false if it does not exist
Expand Down
10 changes: 5 additions & 5 deletions lib/internal/Magento/Framework/Backup/SourceFileInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\Framework\Backup;

/**
* Interface for work with archives
*
* @author Magento Core Team <core@magentocommerce.com>
* @api
*/

namespace Magento\Framework\Backup;

interface SourceFileInterface
{

Expand All @@ -20,7 +20,7 @@ interface SourceFileInterface
*
* @return bool
*/
public function keepSourceFile();
public function keepSourceFile(): bool;

/**
* Set if keep files of backup
Expand Down
9 changes: 5 additions & 4 deletions lib/internal/Magento/Framework/Cache/ConfigInterface.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
<?php
/**
* Cache configuration model. Provides cache configuration data to the application
*
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\Framework\Cache;

/**
* Interface \Magento\Framework\Cache\ConfigInterface
*
* @api
*/
interface ConfigInterface
{
Expand All @@ -18,13 +19,13 @@ interface ConfigInterface
*
* @return array
*/
public function getTypes();
public function getTypes(): array;

/**
* Get configuration of specified cache type
*
* @param string $type
* @return array
*/
public function getType($type);
public function getType($type): array;
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\Framework\Cache;

/**
* Notifier for stale cache retrieval detection
*
* @api
*/
interface StaleCacheNotifierInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\Framework\Code\Generator;

/**
* Interface \Magento\Framework\Code\Generator\CodeGeneratorInterface
*
* @api
*/
interface CodeGeneratorInterface extends \Laminas\Code\Generator\GeneratorInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

/**
* Interface for minification adapters
*/
namespace Magento\Framework\Code\Minifier;

/**
* Interface \Magento\Framework\Code\Minifier\AdapterInterface
*
* @api
*/
interface AdapterInterface
{
Expand All @@ -21,5 +20,5 @@ interface AdapterInterface
* @param string $content
* @return string
*/
public function minify($content);
public function minify($content): string;
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
<?php
/**
*
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\Framework\Code\Reader;

/**
* Interface \Magento\Framework\Code\Reader\ClassReaderInterface
*
* @api
*/
interface ClassReaderInterface
{
Expand All @@ -20,7 +21,7 @@ interface ClassReaderInterface
* @return array|null
* @throws \ReflectionException
*/
public function getConstructor($className);
public function getConstructor($className): ?array;

/**
* Retrieve parent relation information for type in a following format
Expand All @@ -34,5 +35,5 @@ public function getConstructor($className);
* @param string $className
* @return string[]
*/
public function getParents($className);
public function getParents($className): array;
}
5 changes: 4 additions & 1 deletion lib/internal/Magento/Framework/Code/ValidatorInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\Framework\Code;

/**
* Interface \Magento\Framework\Code\ValidatorInterface
*
* @api
*/
interface ValidatorInterface
{
Expand All @@ -18,5 +21,5 @@ interface ValidatorInterface
* @return bool
* @throws \Magento\Framework\Exception\ValidatorException
*/
public function validate($className);
public function validate($className): bool;
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,15 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\Framework\Component;

/**
* Component Registrar Interface
*
* @api
*/
interface ComponentRegistrarInterface
{
/**
Expand All @@ -15,7 +22,7 @@ interface ComponentRegistrarInterface
* @param string $type
* @return array
*/
public function getPaths($type);
public function getPaths($type): array;

/**
* Get path of a component if it is already registered
Expand All @@ -24,5 +31,5 @@ public function getPaths($type);
* @param string $componentName
* @return null|string
*/
public function getPath($type, $componentName);
public function getPath($type, $componentName): ?string;
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\Framework\Crontab;

use Magento\Framework\Exception\LocalizedException;

/**
* Interface \Magento\Framework\Crontab\CrontabManagerInterface
*
* @api
*/
interface CrontabManagerInterface
{
Expand All @@ -26,7 +29,7 @@ interface CrontabManagerInterface
* @return array
* @throws LocalizedException
*/
public function getTasks();
public function getTasks(): array;

/**
* Save Magento Tasks to crontab
Expand All @@ -35,13 +38,13 @@ public function getTasks();
* @return void
* @throws LocalizedException
*/
public function saveTasks(array $tasks);
public function saveTasks(array $tasks): void;

/**
* Remove Magento Tasks form crontab
*
* @return void
* @throws LocalizedException
*/
public function removeTasks();
public function removeTasks(): void;
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\Framework\Crontab;

/**
* Interface \Magento\Framework\Crontab\TasksProviderInterface
*
* @api
*/
interface TasksProviderInterface
{
Expand All @@ -16,5 +19,5 @@ interface TasksProviderInterface
*
* @return array
*/
public function getTasks();
public function getTasks(): array;
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\Framework\Css\PreProcessor;

/**
* Error handler interface
*
* @api
*/
interface ErrorHandlerInterface
{
Expand All @@ -16,5 +20,5 @@ interface ErrorHandlerInterface
* @param \Exception $e
* @return void
*/
public function processException(\Exception $e);
public function processException(\Exception $e): void;
}
Loading

0 comments on commit 7d38777

Please sign in to comment.