Skip to content

Commit

Permalink
add changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ArrayIterator committed Nov 16, 2023
1 parent 7a1a92c commit d933daa
Show file tree
Hide file tree
Showing 81 changed files with 474 additions and 343 deletions.
7 changes: 7 additions & 0 deletions phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@

<!-- Slevomat Ruleset -->
<config name="installed_paths" value="vendor/slevomat/coding-standard/SlevomatCodingStandard"/>
<!-- constant visibility -->
<rule ref="PSR12.Properties">
<properties>
<property name="UseSpacing" value="1"/>
<property name="ConstantVisibility" value="1"/>
</properties>
</rule>
<!-- detect spacing -->
<rule ref="SlevomatCodingStandard.Namespaces.UseSpacing">
<properties>
Expand Down
14 changes: 7 additions & 7 deletions src/Auth/Generator/Interfaces/NonceInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@

interface NonceInterface
{
const NONCE_VALID = true;
const NONCE_EXPIRED = 0;
const NONCE_INVALID = false;
public const NONCE_VALID = true;
public const NONCE_EXPIRED = 0;
public const NONCE_INVALID = false;

const DEFAULT_PERIOD_SECONDS = 21600; // 6 hours
public const DEFAULT_PERIOD_SECONDS = 21600; // 6 hours

const MAXIMUM_PERIOD_SECONDS = 604800; // 7 days
public const MAXIMUM_PERIOD_SECONDS = 604800; // 7 days

const MINIMUM_PERIOD_SECONDS = 30;
public const MINIMUM_PERIOD_SECONDS = 30;

/**
* Create new nonce object
* Create a new nonce object
*
* @param string $nonceKey
* @param string $saltKey
Expand Down
2 changes: 1 addition & 1 deletion src/Auth/Google/Authenticator.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class Authenticator
/**
* Default period range seconds
*/
const PERIOD = 30;
public const PERIOD = 30;

/**
* @param int $time
Expand Down
2 changes: 1 addition & 1 deletion src/Auth/Roles/SuperAdminCapability.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

final class SuperAdminCapability extends AbstractCapability
{
const NAME = 'superadmin';
public const NAME = 'superadmin';

protected string $identity = self::NAME;

Expand Down
2 changes: 1 addition & 1 deletion src/Auth/Roles/SuperAdminRole.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

final class SuperAdminRole extends AbstractRole
{
const NAME = 'superadmin';
public const NAME = 'superadmin';

protected string $identity = self::NAME;

Expand Down
2 changes: 1 addition & 1 deletion src/Benchmark/Formatter/HtmlFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

class HtmlFormatter implements MetadataFormatterInterface
{
const BLACKLISTED_OBJECT = [
public const BLACKLISTED_OBJECT = [
ProfilerInterface::class,
GroupInterface::class,
RecordInterface::class,
Expand Down
2 changes: 1 addition & 1 deletion src/Benchmark/Injector/ManagerProfiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class ManagerProfiler implements EventDispatchListenerInterface
/**
* Profiler Default
*/
const PROVIDERS = [
public const PROVIDERS = [
DatabaseProfilerInjector::class,
KernelProfilerInjector::class,
MiddlewareProfilerInjector::class,
Expand Down
8 changes: 4 additions & 4 deletions src/Benchmark/Interfaces/DurationInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

interface DurationInterface
{
const NUMERIC_INFO = 1;
const NUMERIC_NOTICE = 5;
const NUMERIC_WARNING = 10;
const NUMERIC_CRITICAL = 20;
public const NUMERIC_INFO = 1;
public const NUMERIC_NOTICE = 5;
public const NUMERIC_WARNING = 10;
public const NUMERIC_CRITICAL = 20;

public function getStartTime(): float;

Expand Down
2 changes: 1 addition & 1 deletion src/Benchmark/Interfaces/MicrotimeConversionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

interface MicrotimeConversionInterface
{
const EXPONENT = 1000;
public const EXPONENT = 1000;

/**
* @return float calculate and exponent to 1000 that means on milliseconds
Expand Down
2 changes: 1 addition & 1 deletion src/Benchmark/Interfaces/ProfilerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ interface ProfilerInterface extends
ClearableInterface,
JsonSerializable
{
const DEFAULT_NAME = 'default';
public const DEFAULT_NAME = 'default';

/**
* Disable profiler record
Expand Down
10 changes: 5 additions & 5 deletions src/Benchmark/Interfaces/SeverityInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@

interface SeverityInterface
{
const CRITICAL = 1;
const WARNING = 3;
const NOTICE = 5;
const INFO = 6;
const NONE = 0;
public const CRITICAL = 1;
public const WARNING = 3;
public const NOTICE = 5;
public const INFO = 6;
public const NONE = 0;

/**
* @return int
Expand Down
2 changes: 1 addition & 1 deletion src/Benchmark/Profiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class Profiler implements ProfilerInterface
*/
private SplObjectStorage $aggregators;

const PROVIDERS = [
public const PROVIDERS = [
DatabaseAggregator::class,
KernelAggregator::class,
MiddlewareAggregator::class,
Expand Down
4 changes: 2 additions & 2 deletions src/Benchmark/Waterfall.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ class Waterfall implements ContainerAllocatorInterface
use TranslatorTrait,
ContainerAllocatorTrait;

const UNKNOWN_SEVERITY_CLASSNAME = 'severity-unknown';
public const UNKNOWN_SEVERITY_CLASSNAME = 'severity-unknown';

const SEVERITY_HTML_CLASS_NAMES = [
public const SEVERITY_HTML_CLASS_NAMES = [
SeverityInterface::CRITICAL => 'severity-critical',
SeverityInterface::WARNING => 'severity-warning',
SeverityInterface::NOTICE => 'severity-notice',
Expand Down
2 changes: 1 addition & 1 deletion src/Cache/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class Cache implements AdapterInterface, ContainerIndicateInterface
{
use ManagerAllocatorTrait;

const DEFAULT_NAMESPACE = 'caches';
public const DEFAULT_NAMESPACE = 'caches';

private ?AdapterInterface $adapter = null;
private int $defaultLifetime = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/Cache/Entities/CacheItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#[HasLifecycleCallbacks]
class CacheItem extends AbstractEntity
{
const TABLE_NAME = 'cache_items';
public const TABLE_NAME = 'cache_items';

#[Id]
#[Column(
Expand Down
2 changes: 1 addition & 1 deletion src/Console/Command/BuiltInWebServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ final class BuiltInWebServer extends Command
ContainerAllocatorTrait,
TranslatorTrait;

const BLACKLIST_PORT = [
public const BLACKLIST_PORT = [
80 => 'HTTP',
443 => 'HTTPS',
3306 => 'MySQL',
Expand Down
8 changes: 4 additions & 4 deletions src/Console/Command/Traits/WriterHelperTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

trait WriterHelperTrait
{
const MODE_SUCCESS = true;
const MODE_WARNING = 3;
const MODE_INFO = 4;
const MODE_DANGER = false;
public const MODE_SUCCESS = true;
public const MODE_WARNING = 3;
public const MODE_INFO = 4;
public const MODE_DANGER = false;

protected string $spacing = ' ';

Expand Down
4 changes: 2 additions & 2 deletions src/Container/Factory/ContainerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@

class ContainerFactory implements ContainerFactoryInterface
{
final const DEFAULT_SERVICES = [
final public const DEFAULT_SERVICES = [
// factory
RouteFactoryInterface::class => RouteFactory::class,
ServerRequestFactoryInterface::class => ServerRequestFactory::class,
Expand Down Expand Up @@ -155,7 +155,7 @@ class ContainerFactory implements ContainerFactoryInterface
AssetsJsCssQueue::class => AssetsJsCssQueue::class,
];

const DEFAULT_SERVICE_ALIASES = [
public const DEFAULT_SERVICE_ALIASES = [
// factory
'routeFactory' => RouteFactoryInterface::class,
routeFactory::class => RouteFactoryInterface::class,
Expand Down
10 changes: 6 additions & 4 deletions src/Database/DatabaseEventsCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@

class DatabaseEventsCollector
{
const REGISTERED_NONE = 0;
const REGISTERED_SUBSCRIBER = 1;
const REGISTERED_EVENT = 2;
public const REGISTERED_NONE = 0;

const PROVIDERS = [
public const REGISTERED_SUBSCRIBER = 1;

public const REGISTERED_EVENT = 2;

public const PROVIDERS = [
CreateSchemaToolsEvent::class,
PostLoadEvent::class,
];
Expand Down
6 changes: 3 additions & 3 deletions src/Database/Entities/Abstracts/AbstractAttachment.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ abstract class AbstractAttachment extends AbstractEntity implements
{
use AvailabilityStatusTrait;

const TYPE_DATA = 'data';
const TYPE_UPLOAD = 'upload';
const TYPE_AVATAR = 'avatar';
public const TYPE_DATA = 'data';
public const TYPE_UPLOAD = 'upload';
public const TYPE_AVATAR = 'avatar';

#[Id]
#[GeneratedValue('AUTO')]
Expand Down
8 changes: 4 additions & 4 deletions src/Database/Entities/Abstracts/AbstractUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ abstract class AbstractUser extends AbstractEntity implements
PasswordTrait,
ManagerAllocatorTrait;

const DEFAULT_AUTH_LENGTH = 32;
const MINIMUM_AUTH_LENGTH = 10;
public const DEFAULT_AUTH_LENGTH = 32;
public const MINIMUM_AUTH_LENGTH = 10;

const AUTH_PERIOD = 30;
public const AUTH_PERIOD = 30;

// MAXIMUM AUTH PERIOD is 10 minutes
const MAX_AUTH_PERIOD = 600;
public const MAX_AUTH_PERIOD = 600;

#[Id]
#[GeneratedValue('AUTO')]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,47 +8,47 @@ interface AvailabilityStatusEntityInterface
/**
* Active status
*/
const ACTIVE = 'active';
public const ACTIVE = 'active';

/**
* Disabled status
*/
const DISABLED = 'disabled';
public const DISABLED = 'disabled';

/**
* Closed status
*/
const CLOSED = 'closed';
public const CLOSED = 'closed';

/**
* Published status
*/
const PUBLISHED = 'published';
public const PUBLISHED = 'published';

/**
* Deleted status
*/
const DELETED = 'deleted';
public const DELETED = 'deleted';

/**
* Draft status
*/
const DRAFT = 'draft';
public const DRAFT = 'draft';

/**
* Status is pending review
*/
const PENDING = 'pending';
public const PENDING = 'pending';

/**
* Status is expired
*/
const EXPIRED = 'expired';
public const EXPIRED = 'expired';

/**
* Status is unknown
*/
const UNKNOWN = 'unknown';
public const UNKNOWN = 'unknown';

public function getStatus() : string;

Expand Down
14 changes: 7 additions & 7 deletions src/Database/Entities/Interfaces/UserStatusEntityInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,37 +8,37 @@ interface UserStatusEntityInterface
/**
* Active status
*/
const ACTIVE = 'active';
public const ACTIVE = 'active';

/**
* Deleted status
*/
const DELETED = 'deleted';
public const DELETED = 'deleted';

/**
* Banned status
*/
const BANNED = 'banned';
public const BANNED = 'banned';

/**
* Suspended status
*/
const SUSPENDED = 'suspended';
public const SUSPENDED = 'suspended';

/**
* Expired User
*/
const EXPIRED = 'expired';
public const EXPIRED = 'expired';

/**
* Status is pending review
*/
const PENDING = 'pending';
public const PENDING = 'pending';

/**
* Status is unknown
*/
const UNKNOWN = 'unknown';
public const UNKNOWN = 'unknown';

public function getStatus() : string;

Expand Down
2 changes: 1 addition & 1 deletion src/Database/Events/CreateSchemaToolsEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
#[SubscribeEvent]
class CreateSchemaToolsEvent extends DatabaseEvent implements EventSubscriber
{
const DOCTRINE_VERSION = 2;
public const DOCTRINE_VERSION = 2;

protected function getManager() : ?ManagerInterface
{
Expand Down
11 changes: 7 additions & 4 deletions src/Database/TypeList.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,14 @@
final class TypeList
{
private static bool $registered = false;
const DATA = Data::NAME;
const YEAR = Year::NAME;
const DATA_BLOB = DataBlob::NAME;

const TYPES = [
public const DATA = Data::NAME;

public const YEAR = Year::NAME;

public const DATA_BLOB = DataBlob::NAME;

public const TYPES = [
self::DATA => Data::class,
self::DATA_BLOB => DataBlob::class,
self::YEAR => Year::class,
Expand Down
Loading

0 comments on commit d933daa

Please sign in to comment.