Skip to content

Commit 8dab9ff

Browse files
committed
cs fix
1 parent 8c07af9 commit 8dab9ff

File tree

8 files changed

+30
-20
lines changed

8 files changed

+30
-20
lines changed

src/Admin/SongAdmin.php

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66
use Sonata\AdminBundle\Datagrid\DatagridMapper;
77
use Sonata\AdminBundle\Datagrid\ListMapper;
88
use Sonata\AdminBundle\Form\FormMapper;
9-
use Sonata\AdminBundle\Form\Type\Filter\ChoiceType;
10-
use Sonata\AdminBundle\Route\RouteCollection;
11-
use Sonata\CoreBundle\Form\FormHelper;
129

1310
class SongAdmin extends AbstractAdmin
1411
{
@@ -21,18 +18,18 @@ protected function configureDatagridFilters(DatagridMapper $filter)
2118
protected function configureListFields(ListMapper $list)
2219
{
2320
$list
24-
->addIdentifier('name', null, ['label'=>'标题'])
25-
->add('src', null, ['label'=>'URL'])
26-
->add('srcId', null, ['label'=>'歌曲ID'])
27-
->add('enabled', null, ['editable'=>true, 'label' => '状态']);
21+
->addIdentifier('name', null, ['label' => '标题'])
22+
->add('src', null, ['label' => 'URL'])
23+
->add('srcId', null, ['label' => '歌曲ID'])
24+
->add('enabled', null, ['editable' => true, 'label' => '状态']);
2825
}
2926

3027
protected function configureFormFields(FormMapper $form)
3128
{
3229
$form
33-
->add('name', null, ['label'=>'标题'])
34-
->add('src', null, ['label'=>'URL'])
35-
->add('srcId', null, ['label'=>'歌曲ID'])
30+
->add('name', null, ['label' => '标题'])
31+
->add('src', null, ['label' => 'URL'])
32+
->add('srcId', null, ['label' => '歌曲ID'])
3633
->add('enabled', null, ['label' => '状态']);
3734
}
3835
}

src/Controller/SongController.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,17 @@
88
class SongController extends Controller
99
{
1010
/**
11-
* 获取最近的一首歌
11+
* 获取最近的一首歌.
1212
*
1313
* @return Response
1414
*/
1515
public function getSongAction()
1616
{
1717
$manager = $this->get('phpdish.manager.song');
1818
dump($manager->getLatestSong());
19+
1920
return $this->render('PHPDishDailySongPlugin::_daily_song.html.twig', [
20-
'song' => $manager->getLatestSong()
21+
'song' => $manager->getLatestSong(),
2122
]);
2223
}
2324
}

src/DependencyInjection/PHPDishDailySongExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ final class PHPDishDailySongExtension extends Extension
1717
public function load(array $config, ContainerBuilder $container): void
1818
{
1919
$config = $this->processConfiguration($this->getConfiguration([], $container), $config);
20-
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
20+
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
2121

2222
$loader->load('services.yml');
2323
}

src/Entity/Song.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ public function getName()
4848
public function setName($name)
4949
{
5050
$this->name = $name;
51+
5152
return $this;
5253
}
5354

@@ -65,6 +66,7 @@ public function getSrcId()
6566
public function setSrcId($srcId)
6667
{
6768
$this->srcId = $srcId;
69+
6870
return $this;
6971
}
7072

@@ -82,6 +84,7 @@ public function getSrc()
8284
public function setSrc($src)
8385
{
8486
$this->src = $src;
87+
8588
return $this;
8689
}
8790
}

src/Model/SongInterface.php

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
namespace PHPDish\DailySongPlugin\Model;
34

45
use PHPDish\Bundle\CoreBundle\Model\DateTimeInterface;
@@ -8,38 +9,45 @@
89
interface SongInterface extends IdentifiableInterface, DateTimeInterface, EnabledInterface
910
{
1011
/**
11-
* 设置歌曲名
12+
* 设置歌曲名.
13+
*
1214
* @param string $name
15+
*
1316
* @return SongInterface
1417
*/
1518
public function setName($name);
1619

1720
/**
18-
* 获取歌曲名
21+
* 获取歌曲名.
22+
*
1923
* @return string
2024
*/
2125
public function getName();
2226

2327
/**
24-
* 获取歌曲链接
28+
* 获取歌曲链接.
29+
*
2530
* @return string
2631
*/
2732
public function getSrc();
2833

2934
/**
3035
* @param string $src
36+
*
3137
* @return SongInterface
3238
*/
3339
public function setSrc($src);
3440

3541
/**
3642
* @param string $srcId
43+
*
3744
* @return SongInterface
3845
*/
3946
public function setSrcId($srcId);
4047

4148
/**
42-
* 获取歌曲id
49+
* 获取歌曲id.
50+
*
4351
* @return number
4452
*/
4553
public function getSrcId();

src/Service/SongManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function __construct(EntityManagerInterface $entityManager)
2929
public function getLatestSong()
3030
{
3131
return $this->songRepository->findOneBy(['enabled' => true], [
32-
'createdAt' => 'desc'
32+
'createdAt' => 'desc',
3333
]);
3434
}
3535
}

src/Service/SongManagerInterface.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
interface SongManagerInterface
88
{
99
/**
10-
* 获取最近的一首歌曲
10+
* 获取最近的一首歌曲.
11+
*
1112
* @return SongInterface
1213
*/
1314
public function getLatestSong();

src/Twig/SongExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function __construct(SongManagerInterface $songManager)
2424
public function getFunctions()
2525
{
2626
return [
27-
new \Twig_SimpleFunction('get_latest_song', [$this->songManager, 'getLatestSong'])
27+
new \Twig_SimpleFunction('get_latest_song', [$this->songManager, 'getLatestSong']),
2828
];
2929
}
3030
}

0 commit comments

Comments
 (0)