text
stringlengths
14
100k
source
stringclasses
1 value
repo
stringclasses
810 values
language
stringclasses
13 values
<|fim_prefix|>use ::wasmer::sys::Features; use std::path::Path; use wasmer_wast::Wast; include!(concat!(env!("OUT_DIR"), "/generated_spectests.rs")); pub fn run_wast(mut config: crate::Config, wast_path: &str) -> anyhow::Result<()> { println!("Running wast `{wast_path}`"); let try_nan_canonicalization = wast_...
fim
wasmerio/wasmer
rust
<|fim_prefix|>print(<|fim_suffix|>llo") <|fim_middle|>"he<|endoftext|>
fim
wasmerio/wasmer
python
<|fim_suffix|> "cargo:rustc-env=CARGO_BUILD_TARGET={}", std::env::var("TARGET").unwrap() ); } <|fim_prefix|>fn main() { println!( <|fim_middle|> <|endoftext|>
fim
wasmerio/wasmer
rust
<|fim_prefix|><?php for ($i = 0; $i < 5; $i++) { $sqlite = new SQLite3('/db/.ht.sqlite'); $result = @$sqlite->qu<|fim_suffix|> $sqlite->close(); } else { echo "1"; exit(1); }; } echo "0" ?> <|fim_middle|>ery("SELECT name FROM sqlite_master WHERE type='table'"); if ($result) { ...
fim
wasmerio/wasmer
php
import tempfile import sys temp_dir = tempfile.mkdtemp(prefix='pip-a-')<|endoftext|>
fim
wasmerio/wasmer
python
<|fim_prefix|>import subprocess result = subprocess.run(["/bin/python", '/code/child.py'<|fim_suffix|>returncode}", end="")<|fim_middle|>], capture_output=True, text=True) print(f"{result.<|endoftext|>
fim
wasmerio/wasmer
python
use std::path::PathBuf; use std::{env, path::Path}; pub fn test_files_path() -> PathBuf { Path::new(env!("CARGO_MANIFEST_DIR")) .join("..") .join("..") .join("..") .join("wasmer-test-files") } pub fn c_asset_path() -> PathBuf { test_files_path().join("examples") } pub fn integ...
fim
wasmerio/wasmer
rust
<|fim_suffix|>bc_path().join("bash-1.0.16-f097441a-a80b-4e0d-87d7-684918ef4bb6.webc") } /// A WEBC file containing `wat2wasm`, `wasm-validate`, and other helpful /// WebAssembly-related commands. pub fn wabt() -> PathBuf { c_asset_path().join("wabt-1.0.37.wasmer") } /// The QuickJS interpreter, compiled to a WASI...
fim
wasmerio/wasmer
rust
<|fim_suffix|>ink_code; mod util; pub use assets::*; pub use util::*; <|fim_prefix|>#![forbid(unsafe_code)<|fim_middle|>] mod assets; pub mod fixtures; pub mod l<|endoftext|>
fim
wasmerio/wasmer
rust
<|fim_suffix|>), optimization_flag: String::from("-O2"), object_paths: vec![], output_path: PathBuf::from("a.out"), libwasmer_path: get_libwasmer_path(), } } } impl LinkCode { pub fn run(&self) -> anyhow::Result<()> { let mut command = Command::ne...
fim
wasmerio/wasmer
rust
<|fim_prefix|>use anyhow::bail; use std::path::Path; use std::process::Command; use crate::assets::get_wasmer_path; pub const DEFAULT_WASMER_REG<|fim_suffix|> .expect("stdout is not utf8! need to handle arbitrary bytes"), std::str::from_utf8(&output.stderr) .expect("stderr is...
fim
wasmerio/wasmer
rust
<|fim_prefix|>use std::{fs::OpenOptions, io::Write, path::Path}; use assert_cmd::prelude::OutputAssertExt; use predicates::str::contains; use tempfile::TempDir; use wasmer_integration_tests_cli::wasmer_command; fn setup_wasmer_dir() -> TempDir { let temp = TempDir::new().unwrap(); // The config path and the ...
fim
wasmerio/wasmer
rust
<|fim_suffix|>:fs::read_to_string(app_dir.join("app.yaml"))?; assert_eq!(got, want); Ok(()) } <|fim_prefix|>use assert_cmd::prelude::OutputAssertExt; use wasmer_integration_tests_cli::wasmer_command; #[test] fn wasmer_create_package() -> anyhow::Result<()> { let ciuser_token = std::env::var("DEV_BACKEND_C...
fim
wasmerio/wasmer
rust
<|fim_prefix|>//! Tests of the `wasmer create-exe` command. use std::{ fs, io::prelude::*, path::{Path, PathBuf}, process::Command, }; use anyhow::{Context, bail}; use assert_cmd::prelude::OutputAssertExt; use tempfile::TempDir; use wasmer_integration_tests_cli::*; const JS_TEST_SRC_CODE: &[u8] = ...
fim
wasmerio/wasmer
rust
<|fim_suffix|> .arg(format!("{}", php_app_dir.display())) .arg(format!("{}", app_dir.display())) .output()?; let app_dir = app_dir.join("php"); let mut cmd = wasmer_command(); cmd.arg("deploy") .arg("--non-interactive") .arg("-vvvvvv") .arg(format!("--app-name={app_...
fim
wasmerio/wasmer
rust
<|fim_suffix|>(&out_path) .output() .unwrap(); assert!(!cmd.status.success()); Ok(()) } <|fim_prefix|>use std::path::PathBuf; use wasmer_integration_tests_cli::{fixtures, wasmer_command}; #[test] fn gen_c_header_works_pirita() -> anyhow::Result<()> { let temp_dir = tempfile::tempdir()?; ...
fim
wasmerio/wasmer
rust
<|fim_suffix|>s::read_to_string(path.join("wasmer.toml")).unwrap(), include_str!("./fixtures/init4.toml") ); } <|fim_prefix|>#[macro_use] extern crate pretty_assertions; use assert_cmd::prelude::OutputAssertExt; use tempfile::TempDir; use wasmer_integration_tests_cli::wasmer_command; // Test that wasmer ...
fim
wasmerio/wasmer
rust
<|fim_suffix|> = std::env::var("DEV_BACKEND_CIUSER_TOKEN") .expect("no CIUSER / DEV_BACKEND_CIUSER_TOKEN token"); // Special case: GitHub secrets aren't visible to outside collaborators if ciuser_token.is_empty() { return; } let assert = wasmer_command() .arg("whoami") ....
fim
wasmerio/wasmer
rust
<|fim_suffix|> let Ok(old_contents) = std::fs::read_to_string(path) && contents == old_contents { // File is already up to date return; } let display_path = path.strip_prefix(project_root()).unwrap_or(path); eprintln!("{} was not up-to-date, updating...", display_path.display()...
fim
wasmerio/wasmer
rust
<|fim_prefix|>use axum::{extract::Query, routing::get, Router}; use std::{collections::HashMap, net::SocketAddr}; #[tokio::main] async fn main() { // Building our application <|fim_suffix|> eprintln!("Listening on http://{}", addr); axum::Server::bind(&addr) .serve(app.into_make_service()) .aw...
fim
wasmerio/wasmer
rust
<|fim_suffix|> return 0; } <|fim_prefix|>#include <stdio.h> #include <string.h> int main() { FILE* f = fopen("/mount/testfile.txt", "r"); if (f == NULL) { perror("Failed to open file"); return 1; } char buffer[32]; i<|fim_middle|>f (fgets(buffer, sizeof(buffer), f) != NULL) { if (strcmp(buffer, ...
fim
wasmerio/wasmer
c
<|fim_suffix|>ody", e); return "<non-utf8 body>"; } } addEventListener("fetch", (ev) => { ev.respondWith(handleRequest(ev.request)); }); async function buildResponseJson(req) { const reqBody = await requestBodyToString(req); const data = { url: req.url, method: req.method, headers: Object.fr...
fim
wasmerio/wasmer
javascript
<|fim_prefix|>console.log("Hello, W<|fim_suffix|>d!"); <|fim_middle|>orl<|endoftext|>
fim
wasmerio/wasmer
javascript
<|fim_suffix|>== NULL) { perror("opendir"); return 1; } while ((entry = readdir(dir)) != NULL) { printf("%s\n", entry->d_name); } closedir(dir); return 0; } <|fim_prefix|>#include <dirent.h> #include <stdio.h> #include <string.h> #include <unistd.h> int main(int argc, ch<|fim_middle|>ar* argv[...
fim
wasmerio/wasmer
c
<|fim_prefix|>#include <dirent.h> #include <fcntl.h> #include <stdio.h> #include <stdlib.h> #include <sys/stat.h> #include <unistd.h> int main() { DIR* dir; struct dirent* entry; printf("/:\n"); dir = opendir("/"); if (dir != NULL) { while ((entry = readdir(dir)) != NULL) { printf("%s\n", entry->...
fim
wasmerio/wasmer
c
<|fim_suffix|>["ci_rand"]; ?> <|fim_prefix|><|fim_middle|><? echo $_GET<|endoftext|>
fim
wasmerio/wasmer
php
<|fim_prefix|>/// This test makes sure writing to the same file, when referred to /// by multiple FDs (some of which are shared), works correctly. The /// trace logs generated by Wasmer are also inspected to make sure /// the file is closed properly. #include <fcntl.h> #include <stdio.h> #include <stdlib.h> #include <...
fim
wasmerio/wasmer
c
use assert_cmd::prelude::OutputAssertExt; use wasmer_integration_tests_cli::{fixtures, wasmer_command}; #[test] fn wasmer_publish_bump() { let ciuser_token = std::env::var("DEV_BACKEND_CIUSER_TOKEN").ok(); let tempdir = tempfile::tempdir().unwrap(); let path = tempdir.path(); let username = "ciuser"; ...
fim
wasmerio/wasmer
rust
<|fim_suffix|> = combined_output .find(&output_path.display().to_string()) .unwrap_or_else(|| panic!("missing close trace for output file:\n{combined_output}")); let closed_marker = combined_output.find("last fd closed").unwrap(); assert!( closing_marker < close_log && close_log < close...
fim
wasmerio/wasmer
rust
<|fim_prefix|>use std::{ io::{Read, Write}, path::{Path, PathBuf}, process::{Child, Stdio}, sync::Arc, time::Duration, }; use anyhow::Error; use futures::TryFutureExt; use insta::assert_json_snapshot; use tempfile::NamedTempFile; use wasmer_integration_tests_cli::{get_wasmer_path, set_default_wasm...
fim
wasmerio/wasmer
rust
<|fim_suffix|>asmer.h" #include "wasmer_wasm.h" #include "calc.h" <|fim_prefix|>#include "<|fim_middle|>wasm.h" #include "w<|endoftext|>
fim
wasmerio/wasmer
c
<|fim_prefix|>// // WASM.cpp // DylibExample // // Created by Nathan Horrigan on 17/08/2021. // #include "calc.h" #include <CoreFoundation/CFBundle.h> #include <any> #include <cstdio> #include <cstring> #include <filesystem> #include <fstream> #include <iostream> #include <sstream> #include <vector> std::string ...
fim
wasmerio/wasmer
cpp
// // WASM.hpp // DylibExample // // Created by Nathan Horrigan on 17/08/2021. // #ifndef calc_h #define calc_h #include "wasm.h" #include <stdio.h> #ifdef __cplusplus extern "C" { #endif int calculate_sum(int a, int b); #ifdef __cplusplus } #endif #endif /* calc_h */ <|endoftext|>
fim
wasmerio/wasmer
c
<|fim_prefix|>#[cfg(test)] #[cfg(target_os = "macos")] mod tests { use std::process::{Command, Output, Stdio}; #[test] fn test_runtime() { // Remove anuthing left over from tests remove_existing_artificats(); // Tets the 'DylibExample' scheme let success = run_ios_test("Dyl...
fim
wasmerio/wasmer
rust
<|fim_prefix|>fn main() { println!( "cargo:rustc-<|fim_suffix|>ARGO_CFG_TARGET_ARCH must be provided by cargo") ); println!( "cargo:rustc-env=CFG_TARGET_ENV={}", std::env::var("CARGO_CFG_TARGET_ENV") .expect("CARGO_CFG_TARGET_ENV must be provided by cargo") ); } <|fim...
fim
wasmerio/wasmer
rust
<|fim_suffix|> os: Some("macos".to_string()), arch: None, target_env: None, engine: Some("engine".to_string()), compiler: None, pattern_to_ignore: "other".to_string() } .should_ignore( "...
fim
wasmerio/wasmer
rust
<|fim_suffix|>func.sig.ident.to_string().replace("r#", ""), compiler_name, engine_name, ) && !cfg!(test) { quote! { #[ignore] #f } } else { f } }; let construct_compiler_test = |f...
fim
wasmerio/wasmer
rust
<|fim_suffix|> #[cfg(test)] mod foo { use super:: * ; #[allow(unused)] fn foo(config: crate::Config) { // Do tests } #[cfg(feature = "singlepass")] mod singlepass { use super:: * ; #[tes...
fim
wasmerio/wasmer
rust
<|fim_suffix|> out.buffer.push_str(testsuite); out.buffer.push_str(" {\n"); f(out)?; out.buffer.push_str("}\n"); out.path.pop().unwrap(); Ok(()) } <|fim_prefix|>//! Build library to generate a program which runs all the testsuites. //! //! By generating a separate `#[test]` test for each file, we ...
fim
wasmerio/wasmer
rust
<|fim_prefix|>//! Here we define the processors usable for each test generator use crate::{Test, Testsuite, extract_name}; use std::path::PathBuf; /// Given a Testsuite and a path, process the path in case is a wast /// file. pub fn wast_processor(_out: &mut Testsuite, p: PathBuf) -> Option<Test> { let ext = p.ext...
fim
wasmerio/wasmer
rust
<|fim_suffix|> error in self.errors.iter() { writeln!(f, " • {} ({}:{})", error.message, error.line, error.col)?; } Ok(()) } } <|fim_prefix|>use std::fmt; use thiserror::Error; /// A Directive Error #[derive(Debug)] pub struct DirectiveError { /// The line where the directive is de...
fim
wasmerio/wasmer
rust
<|fim_suffix|> clippy::print_stdout, clippy::unicode_not_nfc, clippy::use_self )] mod error; mod spectest; mod wast; pub use crate::error::{DirectiveError, DirectiveErrors}; pub use crate::spectest::spectest_importobject; pub use crate::wast::Wast; /// Version number of this crate. pub const VERSION: &str = ...
fim
wasmerio/wasmer
rust
<|fim_prefix|>use wasmer::*; /// Return an instance implementing the "spectest" interface used in the /// spec testsuite. #[allow(clippy::print_stdout)] pub fn spectest_importobject(store: &mut Store) -> Imports { let print = Function::new_typed(store, || {}); let print_i32 = Function::new_typed(store, |val: i...
fim
wasmerio/wasmer
rust
<|fim_suffix|>byte buffer. pub fn run_buffer(&mut self, test: &Path, wast: &[u8]) -> Result<()> { let wast = str::from_utf8(wast)?; let filename = test.to_str().unwrap(); let adjust_wast = |mut err: wast::Error| { err.set_path(filename.as_ref()); err.set_text(wast); ...
fim
wasmerio/wasmer
rust
<|fim_suffix|> std::process::exit(0); } <|fim_prefix|>fn main() <|fim_middle|>{<|endoftext|>
fim
wasmerio/wasmer
rust
<|fim_suffix|>pawn(|| std::process::exit(0)).join().unwrap(); } <|fim_prefix|>fn main() { std::thread<|fim_middle|>::s<|endoftext|>
fim
wasmerio/wasmer
rust
<|fim_prefix|>fn main() { std::process::ex<|fim_suffix|><|fim_middle|>it(1); } <|endoftext|>
fim
wasmerio/wasmer
rust
<|fim_prefix|>fn ma<|fim_suffix|>n() { std::thread::spawn(|| std::process::exit(1)).join().unwrap(); } <|fim_middle|>i<|endoftext|>
fim
wasmerio/wasmer
rust
<|fim_prefix|>use std::fs::{self, File}; use std::os::fd::AsRawFd; use std::path::Path; fn print_contents(path: impl AsRef<Path> + Copy) { let contents = fs::read_to_string(path).unwrap(); println!( "{}:{contents}", path.as_ref().to_string_lossy().into_owned() ); } fn main() { unsafe {...
fim
wasmerio/wasmer
rust
<|fim_suffix|>/b").unwrap().is_dir()); std::fs::create_dir("/a").unwrap(); assert!(std::fs::metadata("/a").unwrap().is_dir()); assert!(std::fs::metadata("/b").unwrap().is_dir()); } <|fim_prefix|>fn main() { std::fs::create_dir("/a").unwrap(); <|fim_middle|>assert!(std::fs::metadata("/a").unwrap().i...
fim
wasmerio/wasmer
rust
<|fim_prefix|>fn main() { std::thread::spawn(|| { panic!("child thread <|fim_suffix|>main thread"); std::process::exit(0); } <|fim_middle|>panicking"); }) .join() .unwrap(); println!("In <|endoftext|>
fim
wasmerio/wasmer
rust
<|fim_suffix|> .join() .unwrap(); println!("In main thread"); std::process::exit(0); } <|fim_prefix|>fn main() { std:<|fim_middle|>:thread::spawn(|| { println!("In child thread"); }) <|endoftext|>
fim
wasmerio/wasmer
rust
<|fim_suffix|>efault_jobs()) ] pub jobs: usize, /// The path to the CLI command to use. [default will be searched in $PATH: "wasmer"] #[arg(long)] pub cli_path: Option<String>, /// Whether or not this run should use the linked [`wasmer-backend-api`] library instead of the CLI. #[cfg(feature = ...
fim
wasmerio/wasmer
rust
<|fim_prefix|>mod config; mod packages; mod tester; use self::tester::{TestReport, Tester}; pub use config::*; use indicatif::{MultiProgress, ProgressBar}; use reqwest::header::CONTENT_TYPE; use std::{fs::OpenOptions, io::Write as _, ops::AddAssign, path::Path, sync::Arc, time::Duration}; use tokio::{ sync::{ ...
fim
wasmerio/wasmer
rust
use super::Argus; use crate::ArgusConfig; use futures::StreamExt; use indicatif::{ProgressBar, ProgressStyle}; use reqwest::{Client, header}; use std::{path::PathBuf, sync::Arc, time::Duration}; use tokio::{ fs::File, io::AsyncWriteExt, sync::mpsc::{UnboundedReceiver, UnboundedSender}, }; use tracing::*; us...
fim
wasmerio/wasmer
rust
<|fim_prefix|>use crate::argus::{Argus, ArgusConfig, Backend}; use indicatif::ProgressBar; use std::{fs::File, io::BufReader, path::Path, process::Command, sync::Arc}; use tokio::time::{self, Instant}; use tracing::*; use wasmer_backend_api::types::PackageVersionWithPackage; use webc::{Container, Version, v2::read::Own...
fim
wasmerio/wasmer
rust
<|fim_prefix|>use super::{TestReport, Tester}; use crate::argus::{Argus, ArgusConfig, Backend}; use indicatif::ProgressBar; use std::{fs::File, io::BufReader, sync::Arc}; use tokio::time; use tracing::*; use wasmer::{Engine, NativeEngineExt, Target, sys::Features}; use wasmer_backend_api::types::PackageVersionWithPacka...
fim
wasmerio/wasmer
rust
<|fim_suffix|> identifier of the test runner. /// /// In practice, it will be one of `wasmer_cli` /// or `wasmer_lib`. pub runner_id: String, pub runner_version: String, /// The unique identifier of the compiler backend used to perform the test. pub compiler_backend: String, pub time: ...
fim
wasmerio/wasmer
rust
<|fim_prefix|>mod argus; use argus::*; use clap::Parser; use tracing_su<|fim_suffix|>iber::{EnvFilter, fmt, prelude::*}; #[tokio::main] async fn main() -> anyhow::Result<()> { tracing_subscriber::registry() .with(fmt::layer()) .with(EnvFilter::from_default_env()) .init(); let config =...
fim
wasmerio/wasmer
rust
<|fim_prefix|><?php $finder = PhpCsFixer\Finder::create() ->in<|fim_suffix|> false, ]) ->setFinder($finder) ; <|fim_middle|>(__DIR__.'/src') ->in(__DIR__.'/tests') ; return (new PhpCsFixer\Config()) ->setRiskyAllowed(true) ->setRules([ '@PSR2' => true, '@Symfony' => true, ...
fim
webmozarts/assert
php
<|fim_suffix|>icAnalysisNonReturnGenerator; require_once __DIR__.'/../vendor/autoload.php'; $generator = new MixinGenerator(); file_put_contents(__DIR__.'/../src/Mixin.php', $generator->generate()); file_put_contents(__DIR__.'/../src/HasAssert.php', $generator->generateHasAssert()); (new StaticAnalysisNonReturnGene...
fim
webmozarts/assert
php
<|fim_suffix|> if ($parameterReflection->isDefaultValueAvailable()) { $defaultValue = $parameterReflection->getDefaultValue(); $defaultValue = Assert::nullOrScalar($defaultValue); $parametersDefaults[$parameterReflection->name] = $defaultValue; } ...
fim
webmozarts/assert
php
<|fim_suffix|> } $expectedReplacementCount = substr_count($content, 'return Assert::'); if ($replacementCount !== $expectedReplacementCount) { throw new RuntimeException(sprintf( 'Expected to replace %d return assertions in "%s", replaced %d.', $expect...
fim
webmozarts/assert
php
<?php declare(strict_types=1); /* * This file is part of the webmozart/assert package. * * (c) Bernhard Schussek <bschussek@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Webmozart\Assert; use ArrayAccess;...
fim
webmozarts/assert
php
<|fim_prefix|><?php declare(strict_types=1); namespace Webmozart\Assert; /** @internal Used by the Psalm plugin */ final class HasAssert { public const HAS_ASSERT = [ 'string' => true, 'nullorstring' => true, 'allstring' => true, 'allnullorstring' => true, 'stringnotempty'...
fim
webmozarts/assert
php
<|fim_suffix|> file is part of the webmozart/assert package. * * (c) Bernhard Schussek <bschussek@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Webmozart\Assert; class InvalidArgumentException extends \Inval...
fim
webmozarts/assert
php
<|fim_prefix|><?php declare(strict_types=1); namespace Webmozart\Assert; use Psalm\Internal\Analyzer\Statements\Expression\ExpressionIdentifier; use Psalm\Plugin\EventHandler\AfterMethodCallAnalysisInterface; use Psalm\Plugin\EventHandler\Event\AfterMethodCallAnalysisEvent; use Psalm\Plugin\PluginEntryPointInterface...
fim
webmozarts/assert
php
<|fim_suffix|> ['ipv4', [null], false], ['ipv4', [false], false], ['ipv6', ['192.168.0.1'], false], ['ipv6', ['255.255.255.255'], false], ['ipv6', ['0.0.0.0'], false], ['ipv6', ['2001:0db8:0000:0042:0000:8a2e:0370:7334'], true], ['ipv6'...
fim
webmozarts/assert
php
<|fim_suffix|>t from the class name to be ignored by composer PSR-4 autoloading rules enum DummyEnum { case CaseName; } <|fim_prefix|><?php declare(strict_types=1); namespace Webm<|fim_middle|>ozart\Assert\Tests; // The filename must be differen<|endoftext|>
fim
webmozarts/assert
php
<|fim_prefix|><?php declare(strict_types=1); namespace Webmozart\Assert\Tests; use PHPUnit\Framework\Attributes\BeforeClass; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use ReflectionClass; use ReflectionMethod; use Webmozart\Assert\B...
fim
webmozarts/assert
php
<|fim_prefix|><?php declare(strict_types=1); namespace Webmozart\Assert\Tests\StaticAn<|fim_suffix|> Webmozart\Assert\Assert; /** * @psalm-pure */ function alnum(string $value): string { return Assert::alnum($value); } /** * @psalm-pure */ function nullOrAlnum(?string $value): ?string { return Assert::n...
fim
webmozarts/assert
php
<|fim_suffix|>unction allNullOrAlpha(mixed $value): mixed { return Assert::allNullOrAlpha($value); } <|fim_prefix|><?php declare(strict_types=1);<|fim_middle|> namespace Webmozart\Assert\Tests\StaticAnalysis; use Webmozart\Assert\Assert; /** * @psalm-pure */ function alpha(mixed $value): mixed { return As...
fim
webmozarts/assert
php
<?php declare(strict_types=1); namespace Webmozart\Assert\Tests\StaticAnalysis; use Webmozart\Assert\Assert; /** * @psalm-pure */ function boolean(mixed $value): bool { return Assert::boolean($value); } /** * @psalm-pure */ function nullOrBoolean(mixed $value): ?bool { return Assert::nullOrBoolean($val...
fim
webmozarts/assert
php
<|fim_prefix|><?php decl<|fim_suffix|>@return class-string|null */ function nullOrClassExists(mixed $value): ?string { return Assert::nullOrClassExists($value); } function allClassExists(mixed $value): iterable { return Assert::allClassExists($value); } function allNullOrClassExists(mixed $value): iterable ...
fim
webmozarts/assert
php
<|fim_prefix|><?php declare(strict_types=1); namespace Webmozart\Assert\Tests\StaticAnalysis; use Webmozart\Assert\Assert; /** * @psalm-pure */ function contains(string $value, string $subString): string { return Assert::contains($value, $subString); } /** * @psalm-pure */ function nullOrContains(?string $...
fim
webmozarts/assert
php
<|fim_suffix|> return Assert::allCount($value, $number); } /** * @param iterable<Countable|array|null> $value */ function allNullOrCount(iterable $value, int $number): iterable { return Assert::allCount($value, $number); } <|fim_prefix|><?php declare(strict_types=1); namespace Webmozart\Assert\Tests\Static...
fim
webmozarts/assert
php
<|fim_prefix|><?php declare(strict_types=1); namespace Webmozart\Assert\Tests\StaticAnalysis; use Countable; use Webmozart\Assert\Assert; /** * @param Countable|array $value * @param int|float $min * @param int|float $max */ function countBetween(mixed $value, $min, $max): Countable|array { return Assert::c...
fim
webmozarts/assert
php
<|fim_prefix|><?php declare(strict_types=1); namespace Webmozart\Assert\Tests\StaticAnalysis; use Webmozart\Assert\Assert; /** * @psalm-pure */ function digits(string $value): string { return Assert::digits($value); } /** <|fim_suffix|>nction allNullOrDigits(iterable $value): iterable { return Assert::a...
fim
webmozarts/assert
php
<|fim_suffix|> function nullOrDirectory(mixed $value): mixed { return Assert::nullOrDirectory($value); } function allDirectory(mixed $value): mixed { return Assert::allDirectory($value); } function allNullOrDirectory(mixed $value): mixed { return Assert::allNullOrDirectory($value); } <|fim_prefix|><|fim_m...
fim
webmozarts/assert
php
<|fim_prefix|><?php declare(strict_<|fim_suffix|>:email($value); } function nullOrEmail(?string $value): ?string { return Assert::nullOrEmail($value); } /** * @param iterable<string> $value * @return iterable<string> */ function allEmail(mixed $value): iterable { return Assert::allEmail($value); } /** *...
fim
webmozarts/assert
php
<|fim_prefix|><?php declare(strict_types=1); namespace Webmozart\Assert\Tests\StaticAnalysis; use Webmozart\Assert\Assert; /** * @psalm-pure */ function endsWith(string $value, string $suffix): string { return Assert::endsWith($value, $suffix); } /** * @psalm-pure */ function nullOrEndsWith(?string $v<|fim...
fim
webmozarts/assert
php
<|fim_suffix|>ullOrEq(mixed $value, mixed $expect): mixed { return Assert::nullOrEq($value, $expect); } /** * @param mixed $expect */ function allEq(mixed $value, mixed $expect): mixed { return Assert::allEq($value, $expect); } /** * @param mixed $expect */ function allNullOrEq(mixed $value, mixed $expect...
fim
webmozarts/assert
php
<|fim_suffix|>nction false(mixed $value): bool { return Assert::false($value); } /** * @psalm-pure * * @return null|false */ function nullOrFalse(mixed $value): ?bool { return Assert::nullOrFalse($value); } /** * @psalm-pure */ function allFalse(mixed $value): iterable { return Assert::allFalse($val...
fim
webmozarts/assert
php
<|fim_prefix|><?php declare(strict_types=1); namespace Webmozart\Assert\Tests\StaticAnalysis; use Webmozart\Ass<|fim_suffix|>xed $value): mixed { return Assert::allFile($value); } function allNullOrFile(mixed $value): mixed { return Assert::allNullOrFile($value); } <|fim_middle|>ert\Assert; function file(m...
fim
webmozarts/assert
php
<|fim_suffix|>ts($value); } function allFileExists(mixed $value): mixed { return Assert::allFileExists($value); } function allNullOrFileExists(mixed $value): mixed { return Assert::allNullOrFileExists($value); } <|fim_prefix|><?php declare(strict_types=1); namespace Webmozart\Assert\Tests\StaticAnalysis; u...
fim
webmozarts/assert
php
<|fim_prefix|><?php declare(strict_types=1); namespace Webmozart\Assert\Tests\StaticAnalysis; use Webmozart\Assert\Assert; /** * @psalm-pure */ function<|fim_suffix|>ed $value): iterable { return Assert::allFloat($value); } /** * @psalm-pure */ function allNullOrFloat(mixed $value): iterable { return A...
fim
webmozarts/assert
php
<|fim_suffix|>: mixed { return Assert::allGreaterThan($value, $limit); } /** * @psalm-pure * @param mixed $limit */ function allNullOrGreaterThan(mixed $value, mixed $limit): mixed { return Assert::allNullOrGreaterThan($value, $limit); } <|fim_prefix|><?php declare(strict_types=1); namespace Webmozart\Ass...
fim
webmozarts/assert
php
<|fim_suffix|>nction allNullOrGreaterThanEq(mixed $value, mixed $limit): mixed { return Assert::allNullOrGreaterThanEq($value, $limit); } <|fim_prefix|><?php declare(strict_types=1); namespace Webmozart\Assert\Tests\StaticAnalysis; use Webmozart\Assert\Assert; /** * @psalm-pure */ function greaterThanEq(mixed...
fim
webmozarts/assert
php
<|fim_prefix|><?php declare(strict_types=1); namespace Webmozart\Assert\Tests\Stati<|fim_suffix|>($value, Serializable::class); } /** * @psalm-pure */ function allImplementsInterface(mixed $value): iterable { return Assert::allImplementsInterface($value, Serializable::class); } /** * @psalm-pure */ function...
fim
webmozarts/assert
php
<|fim_suffix|>y(mixed $value, array $values): mixed { return Assert::allNullOrInArray($value, $values); } <|fim_prefix|><?php declare(strict_types=1); namespace Webmozart\Assert\Tests\StaticAnalysis; use Webmozart\Assert\Assert; /** * @psalm-pure */ function inArray(mixed $value, array $values): mixed { r...
fim
webmozarts/assert
php
<|fim_prefix|><?php declare(strict_types=1); namespace Webmozart\Assert\Tests\StaticAnalysis; use Webmozart\Assert\Assert; /** * @psalm-pure */ function in<|fim_suffix|>** * @psalm-pure */ function nullOrInteger(mixed $value): ?int { return Assert::nullOrInteger($value); } /** * @psalm-pure */ function a...
fim
webmozarts/assert
php
<|fim_suffix|>ction allNullOrIntegerish(mixed $value): iterable { return Assert::allNullOrIntegerish($value); } <|fim_prefix|><?php declare(strict_types=1); namespace Webmozart\Assert\Tests\StaticAnalysis; use Webmozart\Assert\Assert; /** * @psalm-pure * * @return numeric */ function integerish(mixed $value...
fim
webmozarts/assert
php
<|fim_prefix|><?php declare(strict_types=1); namespace Webmozart\Assert\Tests\StaticAnalysis; use Webmozart\Assert\Assert; /** * @return class-string */ function interfaceExists(mixed $value): string { return Assert::interfaceExi<|fim_suffix|>NullOrInterfaceExists($value); } <|fim_middle|>sts($value); } /** ...
fim
webmozarts/assert
php
<|fim_suffix|>tring> $value */ function allIp(iterable $value): iterable { return Assert::allIp($value); } /** * @param iterable<string|null> $value */ function allNullOrIp(iterable $value): iterable { return Assert::allNullOrIp($value); } <|fim_prefix|><?php declare(strict_types=1); namespace Webmozart\A...
fim
webmozarts/assert
php
<|fim_prefix|><?php declare(strict_types=1); namespace Webmozart\Assert\Tests\StaticAnalysis; use Webmozart\Assert\Assert; function ipv4(string $value): string { return Assert::ipv4($value); } function nullOrIpv4(?string $value): ?string { return Assert::nullOrIpv4($value); } /** * @param iterable<string...
fim
webmozarts/assert
php
<|fim_suffix|>le $value): iterable { return Assert::allNullOrIpv6($value); } <|fim_prefix|><?php declare(strict_types=1); namespace Webmozart\Assert\Tests\StaticAnalysis; use Webmozart\Assert\Assert; function ipv6(string $value): string { return Assert::ipv6($value); } function nullOrIpv6(?string $value): ...
fim
webmozarts/assert
php
<|fim_prefix|><?php declare(strict_types=1); namespace Webmozart\Assert\Tests\StaticAnalysis; use Serializable; use Webmozart\Assert\Assert; /** * @psalm-pure * * @param object|string $value * * @psalm-return class-string<Serializable>|Serializable */ function isAOf(mixed $value): mixed { return Assert::i...
fim
webmozarts/assert
php
<|fim_suffix|>ring> $classes */ function allNullOrIsAnyOf(mixed $value, array $classes): iterable { return Assert::allNullOrIsAnyOf($value, $classes); } <|fim_prefix|><?php declare(strict_types=1); namespace Webmozart\Assert\Tests\StaticAnalysis; use Webmozart\Assert\Assert; /** * @psalm-pure * * @param obj...
fim
webmozarts/assert
php
<|fim_suffix|> iterable { return Assert::allIsArray($value); } /** * @psalm-pure */ function allNullOrIsArray(mixed $value): iterable { return Assert::allNullOrIsArray($value); } <|fim_prefix|><?php declare(strict_types=1); namespace Webmozart\Assert\Tests\StaticAnalysis; use Webmozart\Assert\Assert; /**...
fim
webmozarts/assert
php
<|fim_suffix|>m-pure */ function allNullOrIsArrayAccessible(mixed $value): iterable { return Assert::allNullOrIsArrayAccessible($value); } <|fim_prefix|><?php declare(strict_types=1); namespace Webmozart\<|fim_middle|>Assert\Tests\StaticAnalysis; use ArrayAccess; use Webmozart\Assert\Assert; /** * @psalm-pure...
fim
webmozarts/assert
php