Converts 'strpos()' calls to improve code readability.

Signed-off-by: Faraz Samapoor <fsamapoor@gmail.com>
This commit is contained in:
Faraz Samapoor
2023-05-07 09:30:01 +03:30
parent ff234f68e1
commit b8566a3a0d
8 changed files with 15 additions and 15 deletions

View File

@@ -53,7 +53,7 @@ class AttachmentController extends Controller {
* @throws \OCA\Deck\NotFoundException
*/
public function display($cardId, $attachmentId) {
if (strpos($attachmentId, ':') === false) {
if (!str_contains($attachmentId, ':')) {
$type = 'deck_file';
} else {
[$type, $attachmentId] = explode(':', $attachmentId);
@@ -76,7 +76,7 @@ class AttachmentController extends Controller {
* @NoAdminRequired
*/
public function update($cardId, $attachmentId) {
if (strpos($attachmentId, ':') === false) {
if (!str_contains($attachmentId, ':')) {
$type = 'deck_file';
} else {
[$type, $attachmentId] = explode(':', $attachmentId);
@@ -88,7 +88,7 @@ class AttachmentController extends Controller {
* @NoAdminRequired
*/
public function delete($cardId, $attachmentId) {
if (strpos($attachmentId, ':') === false) {
if (!str_contains($attachmentId, ':')) {
$type = 'deck_file';
} else {
[$type, $attachmentId] = explode(':', $attachmentId);
@@ -100,7 +100,7 @@ class AttachmentController extends Controller {
* @NoAdminRequired
*/
public function restore($cardId, $attachmentId) {
if (strpos($attachmentId, ':') === false) {
if (!str_contains($attachmentId, ':')) {
$type = 'deck_file';
} else {
[$type, $attachmentId] = explode(':', $attachmentId);