Skip to content

Commit

Permalink
Merge pull request #70 from elcreator/master
Browse files Browse the repository at this point in the history
Generated stubs for Phalcon v5.0.0-alpha7
  • Loading branch information
niden authored Dec 27, 2021
2 parents 55b8c87 + 99f8c25 commit 9655438
Show file tree
Hide file tree
Showing 581 changed files with 9,754 additions and 1,676 deletions.
32 changes: 3 additions & 29 deletions src/Acl/Adapter/AbstractAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@
namespace Phalcon\Acl\Adapter;

use Phalcon\Acl\Enum;
use Phalcon\Events\ManagerInterface;
use Phalcon\Events\AbstractEventsAware;
use Phalcon\Events\EventsAwareInterface;

/**
* Adapter for Phalcon\Acl adapters
*/
abstract class AbstractAdapter implements \Phalcon\Acl\Adapter\AdapterInterface, \Phalcon\Events\EventsAwareInterface
abstract class AbstractAdapter extends AbstractEventsAware implements \Phalcon\Acl\Adapter\AdapterInterface, \Phalcon\Events\EventsAwareInterface
{

/**
* Active access which the list is checking if some role can access it
*
Expand Down Expand Up @@ -54,14 +55,6 @@ abstract class AbstractAdapter implements \Phalcon\Acl\Adapter\AdapterInterface,
*/
protected $defaultAccess = Enum::DENY;

/**
* Events manager
*
* @var ManagerInterface|null
*/
protected $eventsManager;


/**
* Active access which the list is checking if some role can access it
*
Expand Down Expand Up @@ -100,15 +93,6 @@ public function getDefaultAction(): int
{
}

/**
* Returns the internal event manager
*
* @return ManagerInterface|null
*/
public function getEventsManager(): ?ManagerInterface
{
}

/**
* Sets the default access level (Phalcon\Acl::ALLOW or Phalcon\Acl::DENY)
*
Expand All @@ -118,14 +102,4 @@ public function getEventsManager(): ?ManagerInterface
public function setDefaultAction(int $defaultAccess): void
{
}

/**
* Sets the events manager
*
* @param \Phalcon\Events\ManagerInterface $eventsManager
* @return void
*/
public function setEventsManager(\Phalcon\Events\ManagerInterface $eventsManager): void
{
}
}
25 changes: 18 additions & 7 deletions src/Acl/Adapter/AdapterInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
interface AdapterInterface
{


/**
* Do a role inherit from another existing role
*
Expand Down Expand Up @@ -112,13 +113,30 @@ public function getActiveRole(): ?string;
*/
public function getActiveComponent(): ?string;

/**
* Return an array with every component registered in the list
*
* @return array|\Phalcon\Acl\ComponentInterface[]
*/
public function getComponents(): array;

/**
* Returns the default ACL access level
*
* @return int
*/
public function getDefaultAction(): int;

/**
* Returns the inherited roles for a passed role name. If no role name
* has been specified it will return the whole array. If the role has not
* been found it returns an empty array
*
* @param string $roleName
* @return array
*/
public function getInheritedRoles(string $roleName = ''): array;

/**
* Returns the default ACL access level for no arguments provided in
* isAllowed action if there exists func for accessKey
Expand All @@ -134,13 +152,6 @@ public function getNoArgumentsDefaultAction(): int;
*/
public function getRoles(): array;

/**
* Return an array with every component registered in the list
*
* @return array|\Phalcon\Acl\ComponentInterface[]
*/
public function getComponents(): array;

/**
* Check whether a role is allowed to access an action from a component
*
Expand Down
57 changes: 37 additions & 20 deletions src/Acl/Adapter/Memory.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@
use Phalcon\Acl\RoleInterface;
use Phalcon\Acl\Component;
use Phalcon\Acl\Exception;
use Phalcon\Events\Manager as EventsManager;
use Phalcon\Acl\RoleAware;
use Phalcon\Acl\ComponentAware;
use Phalcon\Acl\RoleAwareInterface;
use Phalcon\Acl\ComponentAwareInterface;
use Phalcon\Acl\ComponentInterface;
use ReflectionFunction;

Expand Down Expand Up @@ -85,6 +84,7 @@
*/
class Memory extends \Phalcon\Acl\Adapter\AbstractAdapter
{

/**
* Access
*
Expand Down Expand Up @@ -162,14 +162,6 @@ class Memory extends \Phalcon\Acl\Adapter\AbstractAdapter
*/
protected $roleInherits;

/**
* Roles Names
*
* @var mixed
*/
protected $rolesNames;


/**
* Returns latest function used to acquire access
*
Expand Down Expand Up @@ -358,6 +350,27 @@ public function dropComponentAccess(string $componentName, $accessList): void
{
}

/**
* Return an array with every component registered in the list
*
* @return array|\Phalcon\Acl\ComponentInterface[]
*/
public function getComponents(): array
{
}

/**
* Returns the inherited roles for a passed role name. If no role name
* has been specified it will return the whole array. If the role has not
* been found it returns an empty array
*
* @param string $roleName
* @return array
*/
public function getInheritedRoles(string $roleName = ''): array
{
}

/**
* Returns the default ACL access level for no arguments provided in
* `isAllowed` action if a `func` (callable) exists for `accessKey`
Expand All @@ -377,15 +390,6 @@ public function getRoles(): array
{
}

/**
* Return an array with every component registered in the list
*
* @return array|\Phalcon\Acl\ComponentInterface[]
*/
public function getComponents(): array
{
}

/**
* Check whether a role is allowed to access an action from a component
*
Expand Down Expand Up @@ -464,4 +468,17 @@ private function allowOrDeny(string $roleName, string $componentName, $access, $
private function canAccess(string $roleName, string $componentName, string $access)
{
}

/**
* @param array $collection
* @param string $element
* @param string $elementName
* @param string $suffix
*
* @throws Exception
* @return void
*/
private function checkExists(array $collection, string $element, string $elementName, string $suffix = 'ACL'): void
{
}
}
2 changes: 1 addition & 1 deletion src/Acl/Component.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/
class Component implements \Phalcon\Acl\ComponentInterface
{

/**
* Component description
*
Expand All @@ -28,7 +29,6 @@ class Component implements \Phalcon\Acl\ComponentInterface
*/
private $name;


/**
* Component description
*
Expand Down
25 changes: 25 additions & 0 deletions src/Acl/ComponentAwareInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

/* This file is part of the Phalcon Framework.
*
* (c) Phalcon Team <[email protected]>
*
* For the full copyright and license information, please view the LICENSE.txt
* file that was distributed with this source code.
*/
namespace Phalcon\Acl;

/**
* Interface for classes which could be used in allow method as RESOURCE
*/
interface ComponentAwareInterface
{


/**
* Returns component name
*
* @return string
*/
public function getComponentName(): string;
}
1 change: 1 addition & 0 deletions src/Acl/ComponentInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
interface ComponentInterface
{


/**
* Returns component description
*
Expand Down
2 changes: 0 additions & 2 deletions src/Acl/Enum.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@
*/
class Enum
{

const ALLOW = 1;


const DENY = 0;
}
1 change: 1 addition & 0 deletions src/Acl/Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@
class Exception extends \Phalcon\Exception
{


}
2 changes: 1 addition & 1 deletion src/Acl/Role.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/
class Role implements \Phalcon\Acl\RoleInterface
{

/**
* Role name
*
Expand All @@ -28,7 +29,6 @@ class Role implements \Phalcon\Acl\RoleInterface
*/
private $description;


/**
* Role name
*
Expand Down
25 changes: 25 additions & 0 deletions src/Acl/RoleAwareInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

/* This file is part of the Phalcon Framework.
*
* (c) Phalcon Team <[email protected]>
*
* For the full copyright and license information, please view the LICENSE.txt
* file that was distributed with this source code.
*/
namespace Phalcon\Acl;

/**
* Interface for classes which could be used in allow method as ROLE
*/
interface RoleAwareInterface
{


/**
* Returns role name
*
* @return string
*/
public function getRoleName(): string;
}
1 change: 1 addition & 0 deletions src/Acl/RoleInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
interface RoleInterface
{


/**
* Returns the role name
*
Expand Down
2 changes: 1 addition & 1 deletion src/Annotations/Adapter/AbstractAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
*/
abstract class AbstractAdapter implements \Phalcon\Annotations\Adapter\AdapterInterface
{

/**
* @var array
*/
Expand All @@ -30,7 +31,6 @@ abstract class AbstractAdapter implements \Phalcon\Annotations\Adapter\AdapterIn
*/
protected $reader;


/**
* Parses or retrieves all the annotations found in a class
*
Expand Down
1 change: 1 addition & 0 deletions src/Annotations/Adapter/AdapterInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
interface AdapterInterface
{


/**
* Parses or retrieves all the annotations found in a class
*
Expand Down
4 changes: 2 additions & 2 deletions src/Annotations/Adapter/Apcu.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
*/
class Apcu extends \Phalcon\Annotations\Adapter\AbstractAdapter
{

/**
* @var string
*/
Expand All @@ -32,7 +33,6 @@ class Apcu extends \Phalcon\Annotations\Adapter\AbstractAdapter
*/
protected $ttl = 172800;


/**
* @param array $options = [
* 'prefix' => 'phalcon'
Expand All @@ -49,7 +49,7 @@ public function __construct(array $options = [])
* Reads parsed annotations from APCu
*
* @param string $key
* @return 0|Reflection
* @return bool|Reflection
*/
public function read(string $key)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Annotations/Adapter/Memory.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@
*/
class Memory extends \Phalcon\Annotations\Adapter\AbstractAdapter
{

/**
* @var mixed
*/
protected $data;


/**
* Reads parsed annotations from memory
*
* @param string $key
* @return 0|Reflection
* @return bool|Reflection
*/
public function read(string $key)
{
Expand Down
Loading

0 comments on commit 9655438

Please sign in to comment.