src/SellerLabs/Nucleus/Support/Std.php
public static function concat($one, $other)
    {
        Arguments::define(
            Boa::either(
                Boa::lst(),
                Boa::string()
            ),
            Boa::either(
                Boa::lst(),
                Boa::string()
            )
        )->check($one, $other);

        $oneType = TypeHound::fetch($one);
        $twoType = TypeHound::fetch($other);

        if ($oneType !== $twoType) {
            throw new MismatchedArgumentTypesException(
                __FUNCTION__,
                $one,
                $other
            );
        }

        if ($oneType === ScalarTypes::SCALAR_STRING) {
            return $one . $other;
        }

        return ArrayMap::of($one)->append(ArrayMap::of($other))->toArray();
    }
public static function concat($one, $other)
    {
        Arguments::define(
            Boa::either(
                Boa::lst(),
                Boa::string()
            ),
            Boa::either(
                Boa::lst(),
                Boa::string()
            )
        )->check($one, $other);

        $oneType = TypeHound::fetch($one);
        $twoType = TypeHound::fetch($other);

        if ($oneType !== $twoType) {
            throw new MismatchedArgumentTypesException(
                __FUNCTION__,
                $one,
                $other
            );
        }

        if ($oneType === ScalarTypes::SCALAR_STRING) {
            return $one . $other;
        }

        return ArrayMap::of($one)->append(ArrayMap::of($other))->toArray();
    }
public static function concat ( $ one , $ other ) { Arguments :: define ( Boa :: either ( Boa :: lst ( ) , Boa :: string ( ) ) , Boa :: either ( Boa :: lst ( ) , Boa :: string ( ) ) ) -> check ( $ one , $ other ) ; $ oneType = TypeHound :: fetch ( $ one ) ; $ twoType = TypeHound :: fetch ( $ other ) ; if ( $ oneType !== $ twoType ) { throw new MismatchedArgumentTypesException ( __FUNCTION__ , $ one , $ other ) ; } if ( $ oneType === ScalarTypes :: SCALAR_STRING ) { return $ one . $ other ; } return ArrayMap :: of ( $ one ) -> append ( ArrayMap :: of ( $ other ) ) -> toArray ( ) ; }
Concatenate the two provided values.

@param string|array|Traversable $one
@param string|array|Traversable $other

@throws MismatchedArgumentTypesException
@throws InvalidArgumentException
@return mixed
Concatenate the two provided values .