Generate a public alias for the passed object

@param mixed $subject
@param string $currentAlias
@return string
181235
public function generatePublicAlias($subject, $currentAlias = '')
    {
        $path = $this->urlProvider->url($subject);
        $menuItem = $this->menuManager->getItemBy(array(':path' => $path));
        if (!empty($menuItem)) {
            $parts = array();
            for ($item = $menuItem; !is_null($item->getParent()); $item = $item->getParent()) {
                $parts [] = Str::systemize($item->getTitle());
            }
            $alias = '/' . join('/', array_reverse($parts));
        } else {
            $alias = parent::generatePublicAlias($subject);
        }

        return $alias;
    }
171459
private function get_reply_subject($subject) {
        $prefix = get_string('replysubjectprefix', 'tool_messageinbound');
        if (!(substr($subject, 0, strlen($prefix)) == $prefix)) {
            $subject = $prefix . ' ' . $subject;
        }

        return $subject;
    }
779288
public static function object($alias,$namespace=null,$args=[]) {
        if (isset(self::$pool[$alias])) {
            return self::$pool[$alias];
        }

        //object('dao','\app\Name',[]);3
        //object('dao','\app\Name');2

        //object('\app\Name',[]); 2
        //object('\app\Name');  1

        if($namespace == null) {
            $namespace = $alias;
        }
        elseif(is_array($namespace)) {
            $args = $namespace;
            $namespace = $alias;
        }

        $constructor = static::make($namespace,$args);
        /*
        $reflect = new \ReflectionClass($namespace);
        $constructor = $reflect->getConstructor();
        if (!$constructor || $constructor->getNumberOfParameters() == 0) {
            $constructor = $reflect->newInstance();
        }
        else {
            $constructor = $reflect->newInstanceArgs($args);
        }
        */
        //固化
        if(in_array($alias,Config::$o->pool)) {
            self::$solidify[$alias] = $constructor;
        }
        return self::$pool[$alias] = $constructor;
    }
1204369
public function subject($subject)
	{
		if ($this->config['encode_headers'])
		{
			$subject = $this->encode_mimeheader((string) $subject);
		}
		$this->subject = (string) $subject;

		return $this;
	}
409673
public function mapperFor($subject)
    {
        $class = $this->initialize($subject);

        if(!isset($this->_mappers[$class]))
            throw new Exception("No mapper registered for $class");

        return $this->_mappers[$class];
    }
871993
public static function getSubjectIdentity($subject)
    {
        if ($subject instanceof SubjectIdentityInterface) {
            return $subject;
        }

        if (\is_string($subject)) {
            return SubjectIdentity::fromClassname($subject);
        }

        if (\is_object($subject)) {
            return SubjectIdentity::fromObject($subject);
        }

        throw new UnexpectedTypeException($subject, SubjectIdentityInterface::class.'|object|string');
    }
522953
protected function getSignedJwt(ISubject $subject) : SignedJwt
    {
        $jwtPayload = new JwtPayload();
        $jwtPayload->setIssuer($this->issuer);
        $jwtPayload->setAudience($this->audience);
        $jwtPayload->setSubject($subject->getPrimaryPrincipal()->getId());
        $jwtPayload->setValidFrom((new DateTimeImmutable)->add($this->validFromInterval));
        $jwtPayload->setValidTo((new DateTimeImmutable)->add($this->validToInterval));
        $jwtPayload->setIssuedAt(new DateTimeImmutable());
        $this->addCustomClaims($jwtPayload, $subject);
        $unsignedJwt = new UnsignedJwt(new JwtHeader(), $jwtPayload);

        return SignedJwt::createFromUnsignedJwt($unsignedJwt, $this->signer->sign($unsignedJwt->getUnsignedValue()));
    }
662017
public function also( $subject, $predicate = null, $object = null ) {
		if ( $predicate === null ) {
			$this->where( $this->currentSubject, $this->currentPredicate, $subject );
		} else if ( $object === null ) {
			$this->where( $this->currentSubject, $subject, $predicate );
		} else {
			$this->where( $subject, $predicate, $object );
		}

		return $this;
	}
1002063
public function find($subject)
    {
        if (isset($this->found[$subject])) {
            return $this->serializers[$this->found[$subject]];
        }
        foreach ($this->serializers as $i => $serializer) {
            if ( ! $serializer->accepts($subject)) {
                continue;
            }
            $this->found[$subject] = $i;
            return $serializer;
        }
        throw new RuntimeException(sprintf(
            'No serializer for %s',
            $subject
        ));
    }
659271
public function injectSubject(\PHPCraft\Subject\Subject $subject)
    {
        $this->subjects[$subject->name] = $subject;
    }
1092483
public static function ToCamelCase ($subject, $prefix = '_') {
		return Regex::ReplaceCallback(
			"/(?:^|". $prefix .")([a-z])/",
			function ($matches) {return strtoupper($matches[1]);},
			$subject
		);
	}
742563
private function resolveUserID($subject)
    {
        // Handle `null`, `0`, and any other falsy subject
        if (!$subject) {
            return 0;
        }

        // If an integer is just passed in
        if (is_numeric($subject)) {
            return (int)$subject;
        }

        // If we get an actual user instance
        if ($subject instanceof User || $subject instanceof UserInfo || $subject instanceof EntityUser) {
            return $subject->getUserID();
        }

        // Non-falsy subject that is unsupported
        throw new \InvalidArgumentException(t('Unsupported subject provided. Subject must be a User, UserInfo, or User Entity object.'));
    }
80621
private function resolveSubject(Subject $part)
    {
        $subject = $part->getSubject();
        foreach ($part->getParameters() as $search => $replace) {
            $subject = str_replace($search, $replace, $subject);
        }

        return $subject;
    }
594926
public function filterPath($field, $currentOrderBy, $currentOrder = 'ASC')
    {
        $field = $this->normalizeField($field);

        $request = $this->requestStack->getMasterRequest();
        if ($currentOrderBy === $field) {
            $currentOrder = $currentOrder === 'DESC' ? 'ASC' : 'DESC';
        } else {
            $currentOrder = 'ASC';
        }

        return $this->urlGenerator->generate(
            $request->attributes->get('_route'),
            array_merge($request->query->all(), [
                'entity'  => $request->get('entity'),
                'orderBy' => $field,
                'order'   => $currentOrder,
                'page'    => 1,
            ])
        );
    }
1164731
public function makePayload(JwTSubject $subject)
    {
        return $this->factory()->customClaims($this->getClaimsArray($subject))->make();
    }
984190
public function withSubject(Name $subject): self
    {
        $obj = clone $this;
        $obj->_subject = $subject;
        return $obj;
    }
1175869
public function subject($subject)
    {
        $name = Config::get('name');
        $subject = '[' . $name . '] ' . $subject;
        /**
         * strange subject encode error
         * occurred when there's both chinese and english
         * solution see: https://github.com/swiftmailer/swiftmailer/issues/665
         */
        $subject = '=?utf-8?B?'.base64_encode($subject).'?=';
        $this->message->setSubject($subject);
        return $this;
    }