The with function returns the value it is given. If a closure is passed as the second argument to the function, the closure will be executed and its returned value will be returned:
<?php $callback = function ($value) {
    return (is_numeric($value)) ? $value * 2 : 0;
};

$result = with(5, $callback);


$result = with(null, $callback);


$result = with(5, null);
<?php             $response = $condition;

        }



        return with($response instanceof Response ? $response : new Response(

            (bool) $response === $allowWhenResponseIs, $message, $code

        ))->authorize();

    }
<?php                 ? $this->createModel()->newQuery()

                : $model->newQuery();



        with($query, $this->queryCallback);



        return $query;

    }
<?php             if (is_array($job)) {

                $count += count($job);



                return with($this->prepareBatchedChain($job), function ($chain) {

                    return $chain->first()

                            ->allOnQueue($this->options['queue'] ?? null)

                            ->allOnConnection($this->options['connection'] ?? null)

                            ->chain($chain->slice(1)->values()->all());

                });

            } else {

                $job->withBatchId($this->id);
<?php         if ($question instanceof ChoiceQuestion) {

            foreach ($question->getChoices() as $key => $value) {

                with(new TwoColumnDetail($output))->render($value, $key);

            }

        }
<?php     {

        $this->previousHandlers[$signal] ??= $this->initializeSignal($signal);



        with($this->getHandlers(), function ($handlers) use ($signal) {

            $handlers[$signal] ??= $this->initializeSignal($signal);



            $this->setHandlers($handlers);

        });



        $this->registry->register($signal, $callback);
<?php         $this->registry->register($signal, $callback);



        with($this->getHandlers(), function ($handlers) use ($signal) {

            $lastHandlerInserted = array_pop($handlers[$signal]);



            array_unshift($handlers[$signal], $lastHandlerInserted);



            $this->setHandlers($handlers);

        });

    }
<?php     protected function usingQuestionHelper($callable)

    {

        $property = with(new ReflectionClass(OutputStyle::class))

            ->getParentClass()

            ->getProperty('questionHelper');
<?php     public function render($string, $verbosity = OutputInterface::VERBOSITY_NORMAL)

    {

        with(new Line($this->output))->render('error', $string, $verbosity);

    }

}
<?php             'Console component [%s] not found.', $method

        )));



        return with(new $component($this->output))->render(...$parameters);

    }

}
<?php     public function render($string, $verbosity = OutputInterface::VERBOSITY_NORMAL)

    {

        with(new Line($this->output))->render('info', $string, $verbosity);

    }

}
<?php     public function render($string, $verbosity = OutputInterface::VERBOSITY_NORMAL)

    {

        with(new Line($this->output))

            ->render('warn', $string, $verbosity);

    }

}
<?php     public function dump(Connection $connection, $path)

    {

        with($process = $this->makeProcess(

            $this->baseCommand().' .schema'

        ))->setTimeout(null)->mustRun(null, array_merge($this->baseVariables($this->connection->getConfig()), [


        ]));
<?php     protected function appendMigrationData(string $path)

    {

        with($process = $this->makeProcess(

            $this->baseCommand().' ".dump \''.$this->migrationTable.'\'"'

        ))->mustRun(null, array_merge($this->baseVariables($this->connection->getConfig()), [


        ]));
<?php             $name = get_class($seeder);



            if ($silent === false && isset($this->command)) {

                with(new TwoColumnDetail($this->command->getOutput()))->render(

                    $name,

                    '<fg=yellow;options=bold>RUNNING</>'

                );
<?php             if ($silent === false && isset($this->command)) {

                $runTime = number_format((microtime(true) - $startTime) * 1000);



                with(new TwoColumnDetail($this->command->getOutput()))->render(

                    $name,

                    "<fg=gray>$runTime ms</> <fg=green;options=bold>DONE</>"

                );