Fix psalm issues

pull/3124/head
Julio Montoya 5 years ago
parent ccfee355f1
commit 3316418141
  1. 16
      psalm.xml
  2. 2
      src/CoreBundle/Controller/ResourceController.php
  3. 2
      src/CoreBundle/Entity/AccessUrlRelCourse.php
  4. 2
      src/CoreBundle/Entity/Course.php
  5. 2
      src/CoreBundle/Entity/Manager/SessionManager.php
  6. 4
      src/CoreBundle/Entity/Resource/ResourceFile.php
  7. 2
      src/CoreBundle/Entity/Resource/ResourceNode.php
  8. 2
      src/CoreBundle/Entity/Session.php
  9. 2
      src/CoreBundle/Entity/SessionRelCourseRelUser.php
  10. 2
      src/CoreBundle/Entity/ToolResourceRight.php
  11. 3
      src/CoreBundle/EventListener/MenuListener.php
  12. 2
      src/CoreBundle/Repository/IllustrationRepository.php
  13. 4
      src/CoreBundle/Repository/ResourceRepository.php
  14. 2
      src/CoreBundle/ToolChain.php
  15. 2
      src/CourseBundle/Admin/CourseAdmin.php
  16. 2
      src/CourseBundle/Entity/CTool.php
  17. 2
      src/SkillBundle/Entity/SkillRelItem.php
  18. 5
      src/ThemeBundle/EventListener/SidebarSetupMenuDemoListener.php
  19. 5
      src/ThemeBundle/Theme/ThemeManager.php
  20. 13
      src/UserBundle/Entity/User.php

@ -8,18 +8,12 @@
>
<projectFiles>
<directory name="src" />
<directory name="public/main/group" />
<directory name="public/main/link" />
<!-- <directory name="public/main/session" /> -->
<!--<directory name="public/main/group" />-->
<!--<directory name="public/main/link" />-->
<!-- <directory name="public/main/session" /> -->
<!-- <directory name="public/main/exercise"/> -->
<ignoreFiles>
<directory name="vendor" />
<!-- <directory name="src/AdminBundle" /> -->
<!-- <directory name="src/ClassificationBundle" />-->
<!-- <directory name="src/CoreBundle" />-->
<ignoreFiles>
<directory name="vendor/*" />
<directory name="src/CoreBundle/Migrations" />
<directory name="src/CoreBundle/Component/Editor" />
<!-- <directory name="src/CourseBundle" />-->

@ -131,7 +131,7 @@ class ResourceController extends AbstractResourceController implements CourseCon
);
}
public function getGrid(Request $request, ResourceRepository $repository, Grid $grid, $resourceNodeId): Grid
public function getGrid(Request $request, ResourceRepository $repository, Grid $grid, int $resourceNodeId): Grid
{
$class = $repository->getRepository()->getClassName();

@ -63,7 +63,7 @@ class AccessUrlRelCourse
*
* @return AccessUrlRelCourse
*/
public function setUrl($url)
public function setUrl(AccessUrl $url)
{
$this->url = $url;

@ -432,7 +432,7 @@ class Course extends AbstractResource implements ResourceInterface
/**
* @param $urls
*/
public function setUrls($urls)
public function setUrls(ArrayCollection $urls)
{
$this->urls = new ArrayCollection();
foreach ($urls as $url) {

@ -93,7 +93,7 @@ class SessionManager extends BaseEntityManager
* @param $status
*/
protected function addUserInCourse(
$status,
int $status,
User $user,
Course $course,
Session $session

@ -156,7 +156,7 @@ class ResourceFile
/**
* @return ResourceFile
*/
public function setName($name)
public function setName(string $name)
{
$this->name = $name;
@ -316,7 +316,7 @@ class ResourceFile
/**
* @param $originalName
*/
public function setOriginalName($originalName): self
public function setOriginalName(string $originalName): self
{
$this->originalName = $originalName;

@ -282,7 +282,7 @@ class ResourceNode
/**
* @return ResourceNode
*/
public function setSlug($slug)
public function setSlug(string $slug)
{
if (false !== strpos(self::PATH_SEPARATOR, $slug)) {
throw new \InvalidArgumentException('Invalid character "'.self::PATH_SEPARATOR.'" in resource name.');

@ -434,7 +434,7 @@ class Session
/**
* @param $courses
*/
public function setCourses($courses)
public function setCourses(ArrayCollection $courses)
{
$this->courses = new ArrayCollection();

@ -101,7 +101,7 @@ class SessionRelCourseRelUser
*
* @return $this
*/
public function setUser($user)
public function setUser(User $user)
{
$this->user = $user;

@ -103,7 +103,7 @@ class ToolResourceRight
/**
* @return $this
*/
public function setMask($mask)
public function setMask(int $mask)
{
$this->mask = $mask;

@ -29,8 +29,9 @@ class MenuListener
/**
* @param $route
* @param $items
* @param \Knp\Menu\ItemInterface[] $items
*/
protected function activateByRoute($route, $items)
protected function activateByRoute($route, array $items)
{
/** @var \Knp\Menu\MenuItem $item */
foreach ($items as $item) {

@ -157,7 +157,7 @@ final class IllustrationRepository extends ResourceRepository implements Resourc
return $this->getIllustrationUrlFromNode($resource->getResourceNode(), $filter);
}
public function getIllustrationUrlFromNode(ResourceNode $resourceNode, $filter = ''): string
public function getIllustrationUrlFromNode(ResourceNode $resourceNode, string $filter = ''): string
{
$node = $this->getIllustrationNodeFromParent($resourceNode);

@ -177,7 +177,7 @@ class ResourceRepository extends BaseEntityRepository
*
* @return ResourceInterface
*/
public function find($id, $lockMode = null, $lockVersion = null)
public function find(int $id, $lockMode = null, $lockVersion = null)
{
return $this->getRepository()->find($id);
}
@ -608,7 +608,7 @@ class ResourceRepository extends BaseEntityRepository
return $qb;
}
public function getResourceFromResourceNode($resourceNodeId): ?AbstractResource
public function getResourceFromResourceNode(int $resourceNodeId): ?AbstractResource
{
return $this->getRepository()->findOneBy(['resourceNode' => $resourceNodeId]);
}

@ -221,7 +221,7 @@ class ToolChain
throw new InvalidArgumentException(sprintf("The Tool '%s' doesn't exist.", $name));
}
public function getResourceTypeNameFromRepository($repo)
public function getResourceTypeNameFromRepository(string $repo)
{
if (isset($this->typeList[$repo]) && !empty($this->typeList[$repo])) {
return $this->typeList[$repo];

@ -70,7 +70,7 @@ class CourseAdmin extends AbstractAdmin
* Generate tool inside the course
* @param Course $course
*/
public function updateTools($course)
public function updateTools(Course $course)
{
//$toolChain = $this->getToolChain();
//$tools = $toolChain->getTools();

@ -281,7 +281,7 @@ class CTool extends AbstractResource implements ResourceInterface
/**
* @return CTool
*/
public function setPosition($position)
public function setPosition(int $position)
{
$this->position = $position;

@ -150,7 +150,7 @@ class SkillRelItem
/**
* @return SkillRelItem
*/
public function setSkill($skill)
public function setSkill(Skill $skill)
{
$this->skill = $skill;

@ -38,7 +38,10 @@ class SidebarSetupMenuDemoListener
return $this->activateByRoute($request->get('_route'), $rootItems);
}
protected function activateByRoute($route, $items)
/**
* @param MenuItemModel[] $items
*/
protected function activateByRoute($route, array $items)
{
foreach ($items as $item) { /** @var MenuItemModel $item */
if ($item->hasChildren()) {

@ -41,7 +41,10 @@ class ThemeManager implements ContainerAwareInterface
}
}
public function registerStyle($id, $src, $deps = [])
/**
* @param string[] $deps
*/
public function registerStyle(string $id, string $src, array $deps = [])
{
if (!isset($this->stylesheets[$id])) {
$this->stylesheets[$id] = [

@ -736,8 +736,9 @@ class User extends BaseUser implements ThemeUser, EquatableInterface //implement
/**
* @param $value
* @param (mixed|string|string[])[] $value
*/
public function setPortals($value)
public function setPortals(array $value)
{
$this->portals = $value;
}
@ -755,7 +756,7 @@ class User extends BaseUser implements ThemeUser, EquatableInterface //implement
*
* @return $this
*/
public function setCurriculumItems($items)
public function setCurriculumItems(array $items)
{
$this->curriculumItems = $items;
@ -1466,10 +1467,11 @@ class User extends BaseUser implements ThemeUser, EquatableInterface //implement
/**
* @param $value
* @param string[][] $value
*
* @return $this
*/
public function setSessionCourseSubscriptions($value)
public function setSessionCourseSubscriptions(array $value)
{
$this->sessionCourseSubscriptions = $value;
@ -1732,10 +1734,11 @@ class User extends BaseUser implements ThemeUser, EquatableInterface //implement
/**
* @param $value
* @param string[] $value
*
* @return $this
*/
public function setAchievedSkills($value)
public function setAchievedSkills(array $value)
{
$this->achievedSkills = $value;
@ -1840,7 +1843,7 @@ class User extends BaseUser implements ThemeUser, EquatableInterface //implement
/**
* @return User
*/
public function setCommentedUserSkills($commentedUserSkills)
public function setCommentedUserSkills(array $commentedUserSkills)
{
$this->commentedUserSkills = $commentedUserSkills;

Loading…
Cancel
Save