Skip to content

Commit

Permalink
Merge pull request #18 from vdhicts/master
Browse files Browse the repository at this point in the history
Remove deprecated FILTER_SANITIZE_STRING
  • Loading branch information
FabianBeiner authored Aug 11, 2022
2 parents 4a2cab2 + 722e99a commit 125c55f
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 12 deletions.
7 changes: 3 additions & 4 deletions src/FabianBeiner/Todoist/TodoistCommentsTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ public function createComment(string $commentType, int $typeId, string $comment)
}

$data = $this->preparePostData([
$commentType . '_id' => $typeId,
'content' => $comment,
]);
$commentType . '_id' => $typeId,
'content' => $comment,
]);
/** @var object $result Result of the POST request. */
$result = $this->post('comments', $data);

Expand Down Expand Up @@ -168,7 +168,6 @@ public function getComment(int $commentId)
*/
public function updateComment(int $commentId, string $content): bool
{
$content = filter_var($content, FILTER_SANITIZE_STRING);
if ( ! strlen($content) || ! $this->validateId($commentId)) {
return false;
}
Expand Down
2 changes: 0 additions & 2 deletions src/FabianBeiner/Todoist/TodoistLabelsTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ public function getAllLabels()
*/
public function createLabel(string $labelName, array $optionalParameters = [])
{
$labelName = filter_var($labelName, FILTER_SANITIZE_STRING);
if ( ! strlen($labelName)) {
return false;
}
Expand Down Expand Up @@ -104,7 +103,6 @@ public function getLabel(int $labelId)
*/
public function updateLabel(int $labelId, string $newLabelName, array $optionalParameters = []): bool
{
$newLabelName = filter_var($newLabelName, FILTER_SANITIZE_STRING);
if ( ! strlen($newLabelName) || ! $this->validateId($labelId)) {
return false;
}
Expand Down
2 changes: 0 additions & 2 deletions src/FabianBeiner/Todoist/TodoistProjectsTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ public function getAllProjects()
*/
public function createProject(string $projectName, array $optionalParameters = [])
{
$projectName = filter_var($projectName, FILTER_SANITIZE_STRING);
if ( ! strlen($projectName)) {
return false;
}
Expand Down Expand Up @@ -102,7 +101,6 @@ public function getProject(int $projectId)
*/
public function updateProject(int $projectId, string $newProjectName, array $optionalParameters = []): bool
{
$newProjectName = filter_var($newProjectName, FILTER_SANITIZE_STRING);
if ( ! strlen($newProjectName) || ! $this->validateId($projectId)) {
return false;
}
Expand Down
2 changes: 0 additions & 2 deletions src/FabianBeiner/Todoist/TodoistSectionsTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ public function getAllSections(int $projectId = 0)
*/
public function createSection(string $sectionName, int $projectId, array $optionalParameters = [])
{
$sectionName = filter_var($sectionName, FILTER_SANITIZE_STRING);
if ( ! strlen($sectionName) || ! $this->validateId($projectId)) {
return false;
}
Expand Down Expand Up @@ -110,7 +109,6 @@ public function getSection(int $sectionId)
*/
public function updateSection(int $sectionId, string $newSectionName): bool
{
$newSectionName = filter_var($newSectionName, FILTER_SANITIZE_STRING);
if ( ! strlen($newSectionName) || ! $this->validateId($sectionId)) {
return false;
}
Expand Down
2 changes: 0 additions & 2 deletions src/FabianBeiner/Todoist/TodoistTasksTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ public function getAllTasks(array $options = [])
*/
public function createTask(string $content, array $options = [])
{
$content = filter_var($content, FILTER_SANITIZE_STRING);
if ( ! strlen($content)) {
return false;
}
Expand Down Expand Up @@ -92,7 +91,6 @@ public function getTask(int $taskId)
*/
public function updateTask(int $taskId, string $content = null, array $options = []): bool
{
$content = filter_var($content, FILTER_SANITIZE_STRING);
if ( ! $this->validateId($taskId)) {
return false;
}
Expand Down

0 comments on commit 125c55f

Please sign in to comment.