mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-06 23:33:13 +08:00
Replaced all FQ global function and constants by explicit imports
This commit is contained in:
@@ -9,6 +9,7 @@ use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Shlinkio\Shlink\Common\Entity\AbstractEntity;
|
||||
use Shlinkio\Shlink\Core\Repository\ShortUrlRepository;
|
||||
use function count;
|
||||
|
||||
/**
|
||||
* Class ShortUrl
|
||||
@@ -176,7 +177,7 @@ class ShortUrl extends AbstractEntity
|
||||
|
||||
public function getVisitsCount(): int
|
||||
{
|
||||
return \count($this->visits);
|
||||
return count($this->visits);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
namespace Shlinkio\Shlink\Core\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use JsonSerializable;
|
||||
use Shlinkio\Shlink\Common\Entity\AbstractEntity;
|
||||
use Shlinkio\Shlink\Core\Repository\TagRepository;
|
||||
|
||||
@@ -15,7 +16,7 @@ use Shlinkio\Shlink\Core\Repository\TagRepository;
|
||||
* @ORM\Entity(repositoryClass=TagRepository::class)
|
||||
* @ORM\Table(name="tags")
|
||||
*/
|
||||
class Tag extends AbstractEntity implements \JsonSerializable
|
||||
class Tag extends AbstractEntity implements JsonSerializable
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
|
||||
@@ -5,6 +5,7 @@ namespace Shlinkio\Shlink\Core\Entity;
|
||||
|
||||
use Cake\Chronos\Chronos;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use JsonSerializable;
|
||||
use Shlinkio\Shlink\Common\Entity\AbstractEntity;
|
||||
use Shlinkio\Shlink\Common\Exception\WrongIpException;
|
||||
use Shlinkio\Shlink\Common\Util\IpAddress;
|
||||
@@ -18,7 +19,7 @@ use Shlinkio\Shlink\Core\Repository\VisitRepository;
|
||||
* @ORM\Entity(repositoryClass=VisitRepository::class)
|
||||
* @ORM\Table(name="visits")
|
||||
*/
|
||||
class Visit extends AbstractEntity implements \JsonSerializable
|
||||
class Visit extends AbstractEntity implements JsonSerializable
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
|
||||
@@ -4,8 +4,10 @@ declare(strict_types=1);
|
||||
namespace Shlinkio\Shlink\Core\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use JsonSerializable;
|
||||
use Shlinkio\Shlink\Common\Entity\AbstractEntity;
|
||||
use Zend\Stdlib\ArraySerializableInterface;
|
||||
use function array_key_exists;
|
||||
|
||||
/**
|
||||
* Class VisitLocation
|
||||
@@ -15,7 +17,7 @@ use Zend\Stdlib\ArraySerializableInterface;
|
||||
* @ORM\Entity()
|
||||
* @ORM\Table(name="visit_locations")
|
||||
*/
|
||||
class VisitLocation extends AbstractEntity implements ArraySerializableInterface, \JsonSerializable
|
||||
class VisitLocation extends AbstractEntity implements ArraySerializableInterface, JsonSerializable
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
@@ -135,25 +137,25 @@ class VisitLocation extends AbstractEntity implements ArraySerializableInterface
|
||||
*/
|
||||
public function exchangeArray(array $array): void
|
||||
{
|
||||
if (\array_key_exists('country_code', $array)) {
|
||||
if (array_key_exists('country_code', $array)) {
|
||||
$this->setCountryCode((string) $array['country_code']);
|
||||
}
|
||||
if (\array_key_exists('country_name', $array)) {
|
||||
if (array_key_exists('country_name', $array)) {
|
||||
$this->setCountryName((string) $array['country_name']);
|
||||
}
|
||||
if (\array_key_exists('region_name', $array)) {
|
||||
if (array_key_exists('region_name', $array)) {
|
||||
$this->setRegionName((string) $array['region_name']);
|
||||
}
|
||||
if (\array_key_exists('city', $array)) {
|
||||
if (array_key_exists('city', $array)) {
|
||||
$this->setCityName((string) $array['city']);
|
||||
}
|
||||
if (\array_key_exists('latitude', $array)) {
|
||||
if (array_key_exists('latitude', $array)) {
|
||||
$this->setLatitude((string) $array['latitude']);
|
||||
}
|
||||
if (\array_key_exists('longitude', $array)) {
|
||||
if (array_key_exists('longitude', $array)) {
|
||||
$this->setLongitude((string) $array['longitude']);
|
||||
}
|
||||
if (\array_key_exists('time_zone', $array)) {
|
||||
if (array_key_exists('time_zone', $array)) {
|
||||
$this->setTimezone((string) $array['time_zone']);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user