/** * @param \Nette\Security\IResource $resource * @param bool $allowed */ public function log(IResource $resource, $allowed) { if (count($this->allows) >= self::MAX_LINES) { return; } $this->allows[] = ['resource' => $resource->getResourceId(), 'allowed' => $allowed]; }
/** * @param IResource|string $resource * @return string */ public static function stringifyResource($resource) { return $resource instanceof IResource ? $resource->getResourceId() : $resource; }