Renders a set of names for actors.

@param ComActorsDomainEntityActor|array $actor

@return string
420046
public function actorName($actor, $truncate_after = 1)
    {
        $helper = AnService::get('com:actors.template.helper');

        if (is_array($actor)) {
            $actors = $actor;
            $left_over = count($actors) - $truncate_after;

            if (!$truncate_after || $left_over <= 1) {
                $last_actor = $helper->name(array_pop($actors));

                if (!empty($actors)) {
                    $name = implode(', ', array_map(array($helper, 'name'), $actors));
                    $name = sprintf(AnTranslator::_('COM-STORIES-AND-ACTOR'), $name, $last_actor);
                } else {
                    $name = $last_actor;
                }

                return $name;
            }

            $ids = array_map(function ($actor) {
                        return 'ids[]='.$actor->id;
                    }, $actors);

            $ids = implode('&', $ids);

            $actors = array_splice($actors, 0, $truncate_after);
            $actors = implode(', ', array_map(array($helper, 'name'), $actors));
            $actors = sprintf(AnTranslator::_('COM-STORIES-AND-OTHERS'), $actors, route('option=com_actors&layout=modal&view=actors&'.$ids), AnTranslator::_($left_over));

            return $actors;
        }

        return $helper->name($actor);
    }
1363482
public function normalizeRoleName ($role)
    {
        $role = trim((string) $role);

        if ("" === $role)
        {
            throw new \InvalidArgumentException("Role name can't be empty or only contain whitespace.");
        }

        $role = strtoupper($role);

        return (0 !== strpos($role, "ROLE_"))
            ? "ROLE_{$role}"
            : $role;
    }
1027069
public function equals(StatementObject $actor): bool
    {
        if (!parent::equals($actor)) {
            return false;
        }

        if (!$actor instanceof Actor) {
            return false;
        }

        if ($this->name !== $actor->name) {
            return false;
        }

        if (null !== $this->iri xor null !== $actor->iri) {
            return false;
        }

        if (null !== $this->iri && null !== $actor->iri && !$this->iri->equals($actor->iri)) {
            return false;
        }

        return true;
    }
239105
private function getStringName(array $name) : string
    {
        $names = array_reduce(array_keys($name), function (array $carry, $key) use ($name) : array {
            $carry[] .= $key . '=' . $name[(string) $key];

            return $carry;
        }, []);

        return implode(',', $names);
    }
675330
public function getName(array $keys = [], string $delimiter = "."): string
    {
        if (empty($keys)) {
            return $this->name;
        }

        $keys[] = $this->name;
        return implode($delimiter, $keys);
    }
212161
public function render(Renderable $item)
    {
        $output = '';
        $nl = '';
        $group = $item->group();

        if ($item instanceof AssetContract) {
            return $this->renderAsset($item, $group);
        }

        foreach ($item as $asset) {
            $output .= $nl.$this->renderAsset($asset, $group);
            $nl = "\n";
        }

        return $output;
    }
291884
protected function formatAction($action)
    {
        if (is_array($action)) {
            $action = '\\'.implode('@', $action);
        }

        if ($this->rootNamespace && strpos($action, '\\') !== 0) {
            return $this->rootNamespace.'\\'.$action;
        } else {
            return trim($action, '\\');
        }
    }
649364
protected function createAcceptanceSuite( $actor = 'Acceptance' ) {
		$suiteConfig = array(
			'class_name' => $actor . $this->actorSuffix,
			'modules'    => array(
				'enabled' => array( 
					'WebDriver',
					'WordPress',
					"{$actor}Helper",
				),
				'config'  => array(
					'WebDriver' => array(
						'browser' => 'phantomjs',
					),
				),
			),
		);

		$str  = "# Codeception Test Suite Configuration\n\n";
		$str .= "# suite for acceptance tests.\n";
		$str .= "# perform tests in browser using the WebDriver or PhpBrowser.\n";
		$str .= "# If you need both WebDriver and PHPBrowser tests - create a separate suite.\n\n";

		$str .= Yaml::dump( $suiteConfig, 5 );
		$this->createSuite( 'acceptance', $actor, $str );
	}
461560
private function formatAction(Action $action)
    {
        $info = [
            'envelope' => 'JSON-RPC-2.0',
            'transport' => 'POST',
            'name' => $action->getName(),
            'description' => $action->getDescription(),
            'parameters' => []
        ];

        foreach ($action->getParameters() as $parameter) {
            $parameterInfo = [
                'name' => $parameter->getName(),
                'type' => $parameter->getType(),
                'description' => $parameter->getDescription(),
                'required' => $parameter->isRequired()
            ];

            if (!$parameter->isRequired()) {
                $parameterInfo['default'] = $parameter->getDefault();
            }

            $info['parameters'][] = $parameterInfo;
        }

        if ($action->getResponse()) {
            $response = $action->getResponse();

            $info['response'] = $response->toArray();
        }

        return $info;
    }
1160156
protected function formatAction($action)
    {
        if ($this->rootNamespace && ! (strpos($action, '\\') === 0)) {
            return $this->rootNamespace.'\\'.$action;
        } else {
            return trim($action, '\\');
        }
    }
150544
public function getAliasesForAction($action)
    {
        $action = (array) $action;
        $results = [];
        foreach ($this->getAliasedActions() as $aliasedAction => $actions) {
            if (array_intersect($action, $actions)) {
                $results = array_merge($results, parent::getAliasesForAction($aliasedAction));
            }
        }

        return array_unique($results);
    }
1073678
private static function getActionName(string $action): string
    {
        if ($action === '') {
            return 'index';
        }

        if (in_array(strtolower($action), self::$magicActionMethods)) {
            return '_' . $action;
        }

        return $action;
    }
1275200
public function transform( $names )
	{
		$names = array_merge( $this->_names, (array) $names );

		if( ( $result = array_shift( $names ) ) === null ) {
			return '';
		}

		foreach( $names as $name ) {
			$result .= '[' . $name . ']';
		}

		return $result;
	}
715496
def get_actor(self, name):
        
        return next((x for x in self.actors if x.name == name), None)
1315213
public function identifier($object): string
    {
        if (is_array($object) && isset($object['__identity'])) {
            return $object['__identity'];
        }
        if (is_string($object)) {
            return $object;
        }
        if (!is_object($object)) {
            return '';
        }
        return (string)$this->persistenceManager->getIdentifierByObject($object);
    }
864080
public function my_addActor($actor)
    {
        $node = $this->searchActor($actor);
        if ($node) return false;
        $this->th_addActor($this->node_name, $actor);
        foreach ($this->client as $client) {
            $client->addNodeActor($this->node_name, $actor);
        }
        return true;
    }
294276
public function getProfileImage($actor=null)
    {

        if (is_null($actor)) {
                $actor = $this->container->get('security.token_storage')->getToken()->getUser();
        }

        if ($actor instanceof Actor && $actor->getImage() instanceof Image) {
            $profileImage = '/uploads/images/profile/'.$actor->getId().'/'.$actor->getImage()->getPath();
        } else {
            $profileImage = $this->getDefaultImageProfile();
        }
 
        return  $profileImage;
    }